1#![doc = "MAVLink ASLUAV dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
21#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
22#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23#[cfg_attr(feature = "serde", serde(tag = "type"))]
24#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25#[repr(u32)]
26#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
27pub enum ActuatorConfiguration {
28 #[doc = "Do nothing."]
29 ACTUATOR_CONFIGURATION_NONE = 0,
30 #[doc = "Command the actuator to beep now."]
31 ACTUATOR_CONFIGURATION_BEEP = 1,
32 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
33 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
34 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
35 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
36 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
37 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
38 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
39 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
40}
41impl ActuatorConfiguration {
42 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
43}
44impl Default for ActuatorConfiguration {
45 fn default() -> Self {
46 Self::DEFAULT
47 }
48}
49#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
50#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
51#[cfg_attr(feature = "serde", serde(tag = "type"))]
52#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
53#[repr(u32)]
54#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
55pub enum ActuatorOutputFunction {
56 #[doc = "No function (disabled)."]
57 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
58 #[doc = "Motor 1"]
59 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
60 #[doc = "Motor 2"]
61 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
62 #[doc = "Motor 3"]
63 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
64 #[doc = "Motor 4"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
66 #[doc = "Motor 5"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
68 #[doc = "Motor 6"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
70 #[doc = "Motor 7"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
72 #[doc = "Motor 8"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
74 #[doc = "Motor 9"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
76 #[doc = "Motor 10"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
78 #[doc = "Motor 11"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
80 #[doc = "Motor 12"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
82 #[doc = "Motor 13"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
84 #[doc = "Motor 14"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
86 #[doc = "Motor 15"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
88 #[doc = "Motor 16"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
90 #[doc = "Servo 1"]
91 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
92 #[doc = "Servo 2"]
93 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
94 #[doc = "Servo 3"]
95 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
96 #[doc = "Servo 4"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
98 #[doc = "Servo 5"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
100 #[doc = "Servo 6"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
102 #[doc = "Servo 7"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
104 #[doc = "Servo 8"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
106 #[doc = "Servo 9"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
108 #[doc = "Servo 10"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
110 #[doc = "Servo 11"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
112 #[doc = "Servo 12"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
114 #[doc = "Servo 13"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
116 #[doc = "Servo 14"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
118 #[doc = "Servo 15"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
120 #[doc = "Servo 16"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
122}
123impl ActuatorOutputFunction {
124 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
125}
126impl Default for ActuatorOutputFunction {
127 fn default() -> Self {
128 Self::DEFAULT
129 }
130}
131#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
133#[cfg_attr(feature = "serde", serde(tag = "type"))]
134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
135#[repr(u32)]
136#[doc = "Enumeration of the ADSB altimeter types"]
137pub enum AdsbAltitudeType {
138 #[doc = "Altitude reported from a Baro source using QNH reference"]
139 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
140 #[doc = "Altitude reported from a GNSS source"]
141 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
142}
143impl AdsbAltitudeType {
144 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
145}
146impl Default for AdsbAltitudeType {
147 fn default() -> Self {
148 Self::DEFAULT
149 }
150}
151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
153#[cfg_attr(feature = "serde", serde(tag = "type"))]
154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
155#[repr(u32)]
156#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
157pub enum AdsbEmitterType {
158 ADSB_EMITTER_TYPE_NO_INFO = 0,
159 ADSB_EMITTER_TYPE_LIGHT = 1,
160 ADSB_EMITTER_TYPE_SMALL = 2,
161 ADSB_EMITTER_TYPE_LARGE = 3,
162 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
163 ADSB_EMITTER_TYPE_HEAVY = 5,
164 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
165 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
166 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
167 ADSB_EMITTER_TYPE_GLIDER = 9,
168 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
169 ADSB_EMITTER_TYPE_PARACHUTE = 11,
170 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
171 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
172 ADSB_EMITTER_TYPE_UAV = 14,
173 ADSB_EMITTER_TYPE_SPACE = 15,
174 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
175 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
176 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
177 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
178}
179impl AdsbEmitterType {
180 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
181}
182impl Default for AdsbEmitterType {
183 fn default() -> Self {
184 Self::DEFAULT
185 }
186}
187bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
188impl AdsbFlags {
189 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
190}
191impl Default for AdsbFlags {
192 fn default() -> Self {
193 Self::DEFAULT
194 }
195}
196bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
197impl AisFlags {
198 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
199}
200impl Default for AisFlags {
201 fn default() -> Self {
202 Self::DEFAULT
203 }
204}
205#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
207#[cfg_attr(feature = "serde", serde(tag = "type"))]
208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
209#[repr(u32)]
210#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
211pub enum AisNavStatus {
212 #[doc = "Under way using engine."]
213 UNDER_WAY = 0,
214 AIS_NAV_ANCHORED = 1,
215 AIS_NAV_UN_COMMANDED = 2,
216 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
217 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
218 AIS_NAV_MOORED = 5,
219 AIS_NAV_AGROUND = 6,
220 AIS_NAV_FISHING = 7,
221 AIS_NAV_SAILING = 8,
222 AIS_NAV_RESERVED_HSC = 9,
223 AIS_NAV_RESERVED_WIG = 10,
224 AIS_NAV_RESERVED_1 = 11,
225 AIS_NAV_RESERVED_2 = 12,
226 AIS_NAV_RESERVED_3 = 13,
227 #[doc = "Search And Rescue Transponder."]
228 AIS_NAV_AIS_SART = 14,
229 #[doc = "Not available (default)."]
230 AIS_NAV_UNKNOWN = 15,
231}
232impl AisNavStatus {
233 pub const DEFAULT: Self = Self::UNDER_WAY;
234}
235impl Default for AisNavStatus {
236 fn default() -> Self {
237 Self::DEFAULT
238 }
239}
240#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
242#[cfg_attr(feature = "serde", serde(tag = "type"))]
243#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
244#[repr(u32)]
245#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
246pub enum AisType {
247 #[doc = "Not available (default)."]
248 AIS_TYPE_UNKNOWN = 0,
249 AIS_TYPE_RESERVED_1 = 1,
250 AIS_TYPE_RESERVED_2 = 2,
251 AIS_TYPE_RESERVED_3 = 3,
252 AIS_TYPE_RESERVED_4 = 4,
253 AIS_TYPE_RESERVED_5 = 5,
254 AIS_TYPE_RESERVED_6 = 6,
255 AIS_TYPE_RESERVED_7 = 7,
256 AIS_TYPE_RESERVED_8 = 8,
257 AIS_TYPE_RESERVED_9 = 9,
258 AIS_TYPE_RESERVED_10 = 10,
259 AIS_TYPE_RESERVED_11 = 11,
260 AIS_TYPE_RESERVED_12 = 12,
261 AIS_TYPE_RESERVED_13 = 13,
262 AIS_TYPE_RESERVED_14 = 14,
263 AIS_TYPE_RESERVED_15 = 15,
264 AIS_TYPE_RESERVED_16 = 16,
265 AIS_TYPE_RESERVED_17 = 17,
266 AIS_TYPE_RESERVED_18 = 18,
267 AIS_TYPE_RESERVED_19 = 19,
268 #[doc = "Wing In Ground effect."]
269 AIS_TYPE_WIG = 20,
270 AIS_TYPE_WIG_HAZARDOUS_A = 21,
271 AIS_TYPE_WIG_HAZARDOUS_B = 22,
272 AIS_TYPE_WIG_HAZARDOUS_C = 23,
273 AIS_TYPE_WIG_HAZARDOUS_D = 24,
274 AIS_TYPE_WIG_RESERVED_1 = 25,
275 AIS_TYPE_WIG_RESERVED_2 = 26,
276 AIS_TYPE_WIG_RESERVED_3 = 27,
277 AIS_TYPE_WIG_RESERVED_4 = 28,
278 AIS_TYPE_WIG_RESERVED_5 = 29,
279 AIS_TYPE_FISHING = 30,
280 AIS_TYPE_TOWING = 31,
281 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
282 AIS_TYPE_TOWING_LARGE = 32,
283 #[doc = "Dredging or other underwater ops."]
284 AIS_TYPE_DREDGING = 33,
285 AIS_TYPE_DIVING = 34,
286 AIS_TYPE_MILITARY = 35,
287 AIS_TYPE_SAILING = 36,
288 AIS_TYPE_PLEASURE = 37,
289 AIS_TYPE_RESERVED_20 = 38,
290 AIS_TYPE_RESERVED_21 = 39,
291 #[doc = "High Speed Craft."]
292 AIS_TYPE_HSC = 40,
293 AIS_TYPE_HSC_HAZARDOUS_A = 41,
294 AIS_TYPE_HSC_HAZARDOUS_B = 42,
295 AIS_TYPE_HSC_HAZARDOUS_C = 43,
296 AIS_TYPE_HSC_HAZARDOUS_D = 44,
297 AIS_TYPE_HSC_RESERVED_1 = 45,
298 AIS_TYPE_HSC_RESERVED_2 = 46,
299 AIS_TYPE_HSC_RESERVED_3 = 47,
300 AIS_TYPE_HSC_RESERVED_4 = 48,
301 AIS_TYPE_HSC_UNKNOWN = 49,
302 AIS_TYPE_PILOT = 50,
303 #[doc = "Search And Rescue vessel."]
304 AIS_TYPE_SAR = 51,
305 AIS_TYPE_TUG = 52,
306 AIS_TYPE_PORT_TENDER = 53,
307 #[doc = "Anti-pollution equipment."]
308 AIS_TYPE_ANTI_POLLUTION = 54,
309 AIS_TYPE_LAW_ENFORCEMENT = 55,
310 AIS_TYPE_SPARE_LOCAL_1 = 56,
311 AIS_TYPE_SPARE_LOCAL_2 = 57,
312 AIS_TYPE_MEDICAL_TRANSPORT = 58,
313 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
314 AIS_TYPE_NONECOMBATANT = 59,
315 AIS_TYPE_PASSENGER = 60,
316 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
317 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
318 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
319 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
320 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
321 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
322 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
323 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
324 AIS_TYPE_PASSENGER_UNKNOWN = 69,
325 AIS_TYPE_CARGO = 70,
326 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
327 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
328 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
329 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
330 AIS_TYPE_CARGO_RESERVED_1 = 75,
331 AIS_TYPE_CARGO_RESERVED_2 = 76,
332 AIS_TYPE_CARGO_RESERVED_3 = 77,
333 AIS_TYPE_CARGO_RESERVED_4 = 78,
334 AIS_TYPE_CARGO_UNKNOWN = 79,
335 AIS_TYPE_TANKER = 80,
336 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
337 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
338 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
339 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
340 AIS_TYPE_TANKER_RESERVED_1 = 85,
341 AIS_TYPE_TANKER_RESERVED_2 = 86,
342 AIS_TYPE_TANKER_RESERVED_3 = 87,
343 AIS_TYPE_TANKER_RESERVED_4 = 88,
344 AIS_TYPE_TANKER_UNKNOWN = 89,
345 AIS_TYPE_OTHER = 90,
346 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
347 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
348 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
349 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
350 AIS_TYPE_OTHER_RESERVED_1 = 95,
351 AIS_TYPE_OTHER_RESERVED_2 = 96,
352 AIS_TYPE_OTHER_RESERVED_3 = 97,
353 AIS_TYPE_OTHER_RESERVED_4 = 98,
354 AIS_TYPE_OTHER_UNKNOWN = 99,
355}
356impl AisType {
357 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
358}
359impl Default for AisType {
360 fn default() -> Self {
361 Self::DEFAULT
362 }
363}
364bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
365impl AttitudeTargetTypemask {
366 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
367}
368impl Default for AttitudeTargetTypemask {
369 fn default() -> Self {
370 Self::DEFAULT
371 }
372}
373#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
375#[cfg_attr(feature = "serde", serde(tag = "type"))]
376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
377#[repr(u32)]
378#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
379pub enum AutotuneAxis {
380 #[doc = "Autotune roll axis."]
381 AUTOTUNE_AXIS_ROLL = 1,
382 #[doc = "Autotune pitch axis."]
383 AUTOTUNE_AXIS_PITCH = 2,
384 #[doc = "Autotune yaw axis."]
385 AUTOTUNE_AXIS_YAW = 4,
386}
387impl AutotuneAxis {
388 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
389}
390impl Default for AutotuneAxis {
391 fn default() -> Self {
392 Self::DEFAULT
393 }
394}
395bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
396impl CameraCapFlags {
397 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
398}
399impl Default for CameraCapFlags {
400 fn default() -> Self {
401 Self::DEFAULT
402 }
403}
404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
406#[cfg_attr(feature = "serde", serde(tag = "type"))]
407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
408#[repr(u32)]
409#[doc = "Camera Modes."]
410pub enum CameraMode {
411 #[doc = "Camera is in image/photo capture mode."]
412 CAMERA_MODE_IMAGE = 0,
413 #[doc = "Camera is in video capture mode."]
414 CAMERA_MODE_VIDEO = 1,
415 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
416 CAMERA_MODE_IMAGE_SURVEY = 2,
417}
418impl CameraMode {
419 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
420}
421impl Default for CameraMode {
422 fn default() -> Self {
423 Self::DEFAULT
424 }
425}
426#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
428#[cfg_attr(feature = "serde", serde(tag = "type"))]
429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
430#[repr(u32)]
431#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
432pub enum CameraSource {
433 #[doc = "Default camera source."]
434 CAMERA_SOURCE_DEFAULT = 0,
435 #[doc = "RGB camera source."]
436 CAMERA_SOURCE_RGB = 1,
437 #[doc = "IR camera source."]
438 CAMERA_SOURCE_IR = 2,
439 #[doc = "NDVI camera source."]
440 CAMERA_SOURCE_NDVI = 3,
441}
442impl CameraSource {
443 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
444}
445impl Default for CameraSource {
446 fn default() -> Self {
447 Self::DEFAULT
448 }
449}
450#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
452#[cfg_attr(feature = "serde", serde(tag = "type"))]
453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
454#[repr(u32)]
455#[doc = "Camera tracking modes"]
456pub enum CameraTrackingMode {
457 #[doc = "Not tracking"]
458 CAMERA_TRACKING_MODE_NONE = 0,
459 #[doc = "Target is a point"]
460 CAMERA_TRACKING_MODE_POINT = 1,
461 #[doc = "Target is a rectangle"]
462 CAMERA_TRACKING_MODE_RECTANGLE = 2,
463}
464impl CameraTrackingMode {
465 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
466}
467impl Default for CameraTrackingMode {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking status flags"]
478pub enum CameraTrackingStatusFlags {
479 #[doc = "Camera is not tracking"]
480 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
481 #[doc = "Camera is tracking"]
482 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
483 #[doc = "Camera tracking in error state"]
484 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
485}
486impl CameraTrackingStatusFlags {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
488}
489impl Default for CameraTrackingStatusFlags {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
495impl CameraTrackingTargetData {
496 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
497}
498impl Default for CameraTrackingTargetData {
499 fn default() -> Self {
500 Self::DEFAULT
501 }
502}
503#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
505#[cfg_attr(feature = "serde", serde(tag = "type"))]
506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
507#[repr(u32)]
508#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
509pub enum CameraZoomType {
510 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
511 ZOOM_TYPE_STEP = 0,
512 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
513 ZOOM_TYPE_CONTINUOUS = 1,
514 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
515 ZOOM_TYPE_RANGE = 2,
516 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
517 ZOOM_TYPE_FOCAL_LENGTH = 3,
518 #[doc = "Zoom value as horizontal field of view in degrees."]
519 ZOOM_TYPE_HORIZONTAL_FOV = 4,
520}
521impl CameraZoomType {
522 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
523}
524impl Default for CameraZoomType {
525 fn default() -> Self {
526 Self::DEFAULT
527 }
528}
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534pub enum CanFilterOp {
535 CAN_FILTER_REPLACE = 0,
536 CAN_FILTER_ADD = 1,
537 CAN_FILTER_REMOVE = 2,
538}
539impl CanFilterOp {
540 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
541}
542impl Default for CanFilterOp {
543 fn default() -> Self {
544 Self::DEFAULT
545 }
546}
547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
549#[cfg_attr(feature = "serde", serde(tag = "type"))]
550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
551#[repr(u32)]
552#[doc = "Possible responses from a CELLULAR_CONFIG message."]
553pub enum CellularConfigResponse {
554 #[doc = "Changes accepted."]
555 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
556 #[doc = "Invalid APN."]
557 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
558 #[doc = "Invalid PIN."]
559 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
560 #[doc = "Changes rejected."]
561 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
562 #[doc = "PUK is required to unblock SIM card."]
563 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
564}
565impl CellularConfigResponse {
566 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
567}
568impl Default for CellularConfigResponse {
569 fn default() -> Self {
570 Self::DEFAULT
571 }
572}
573#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
575#[cfg_attr(feature = "serde", serde(tag = "type"))]
576#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
577#[repr(u32)]
578#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
579pub enum CellularNetworkFailedReason {
580 #[doc = "No error"]
581 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
582 #[doc = "Error state is unknown"]
583 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
584 #[doc = "SIM is required for the modem but missing"]
585 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
586 #[doc = "SIM is available, but not usable for connection"]
587 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
588}
589impl CellularNetworkFailedReason {
590 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
591}
592impl Default for CellularNetworkFailedReason {
593 fn default() -> Self {
594 Self::DEFAULT
595 }
596}
597#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
599#[cfg_attr(feature = "serde", serde(tag = "type"))]
600#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
601#[repr(u32)]
602#[doc = "Cellular network radio type"]
603pub enum CellularNetworkRadioType {
604 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
605 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
606 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
607 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
608 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
609}
610impl CellularNetworkRadioType {
611 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
612}
613impl Default for CellularNetworkRadioType {
614 fn default() -> Self {
615 Self::DEFAULT
616 }
617}
618#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
619#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
620#[cfg_attr(feature = "serde", serde(tag = "type"))]
621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
622#[repr(u32)]
623#[doc = "These flags encode the cellular network status"]
624pub enum CellularStatusFlag {
625 #[doc = "State unknown or not reportable."]
626 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
627 #[doc = "Modem is unusable"]
628 CELLULAR_STATUS_FLAG_FAILED = 1,
629 #[doc = "Modem is being initialized"]
630 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
631 #[doc = "Modem is locked"]
632 CELLULAR_STATUS_FLAG_LOCKED = 3,
633 #[doc = "Modem is not enabled and is powered down"]
634 CELLULAR_STATUS_FLAG_DISABLED = 4,
635 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
636 CELLULAR_STATUS_FLAG_DISABLING = 5,
637 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
638 CELLULAR_STATUS_FLAG_ENABLING = 6,
639 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
640 CELLULAR_STATUS_FLAG_ENABLED = 7,
641 #[doc = "Modem is searching for a network provider to register"]
642 CELLULAR_STATUS_FLAG_SEARCHING = 8,
643 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
644 CELLULAR_STATUS_FLAG_REGISTERED = 9,
645 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
646 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
647 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
648 CELLULAR_STATUS_FLAG_CONNECTING = 11,
649 #[doc = "One or more packet data bearers is active and connected"]
650 CELLULAR_STATUS_FLAG_CONNECTED = 12,
651}
652impl CellularStatusFlag {
653 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
654}
655impl Default for CellularStatusFlag {
656 fn default() -> Self {
657 Self::DEFAULT
658 }
659}
660#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
662#[cfg_attr(feature = "serde", serde(tag = "type"))]
663#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
664#[repr(u32)]
665#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
666pub enum CompMetadataType {
667 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
668 COMP_METADATA_TYPE_GENERAL = 0,
669 #[doc = "Parameter meta data."]
670 COMP_METADATA_TYPE_PARAMETER = 1,
671 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
672 COMP_METADATA_TYPE_COMMANDS = 2,
673 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
674 COMP_METADATA_TYPE_PERIPHERALS = 3,
675 #[doc = "Meta data for the events interface."]
676 COMP_METADATA_TYPE_EVENTS = 4,
677 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
678 COMP_METADATA_TYPE_ACTUATORS = 5,
679}
680impl CompMetadataType {
681 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
682}
683impl Default for CompMetadataType {
684 fn default() -> Self {
685 Self::DEFAULT
686 }
687}
688#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
690#[cfg_attr(feature = "serde", serde(tag = "type"))]
691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
692#[repr(u32)]
693#[doc = "Indicates the ESC connection type."]
694pub enum EscConnectionType {
695 #[doc = "Traditional PPM ESC."]
696 ESC_CONNECTION_TYPE_PPM = 0,
697 #[doc = "Serial Bus connected ESC."]
698 ESC_CONNECTION_TYPE_SERIAL = 1,
699 #[doc = "One Shot PPM ESC."]
700 ESC_CONNECTION_TYPE_ONESHOT = 2,
701 #[doc = "I2C ESC."]
702 ESC_CONNECTION_TYPE_I2C = 3,
703 #[doc = "CAN-Bus ESC."]
704 ESC_CONNECTION_TYPE_CAN = 4,
705 #[doc = "DShot ESC."]
706 ESC_CONNECTION_TYPE_DSHOT = 5,
707}
708impl EscConnectionType {
709 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
710}
711impl Default for EscConnectionType {
712 fn default() -> Self {
713 Self::DEFAULT
714 }
715}
716bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
717impl EscFailureFlags {
718 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
719}
720impl Default for EscFailureFlags {
721 fn default() -> Self {
722 Self::DEFAULT
723 }
724}
725bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
726impl EstimatorStatusFlags {
727 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
728}
729impl Default for EstimatorStatusFlags {
730 fn default() -> Self {
731 Self::DEFAULT
732 }
733}
734#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
735#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
736#[cfg_attr(feature = "serde", serde(tag = "type"))]
737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
738#[repr(u32)]
739#[doc = "List of possible failure type to inject."]
740pub enum FailureType {
741 #[doc = "No failure injected, used to reset a previous failure."]
742 FAILURE_TYPE_OK = 0,
743 #[doc = "Sets unit off, so completely non-responsive."]
744 FAILURE_TYPE_OFF = 1,
745 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
746 FAILURE_TYPE_STUCK = 2,
747 #[doc = "Unit is reporting complete garbage."]
748 FAILURE_TYPE_GARBAGE = 3,
749 #[doc = "Unit is consistently wrong."]
750 FAILURE_TYPE_WRONG = 4,
751 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
752 FAILURE_TYPE_SLOW = 5,
753 #[doc = "Data of unit is delayed in time."]
754 FAILURE_TYPE_DELAYED = 6,
755 #[doc = "Unit is sometimes working, sometimes not."]
756 FAILURE_TYPE_INTERMITTENT = 7,
757}
758impl FailureType {
759 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
760}
761impl Default for FailureType {
762 fn default() -> Self {
763 Self::DEFAULT
764 }
765}
766#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
768#[cfg_attr(feature = "serde", serde(tag = "type"))]
769#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
770#[repr(u32)]
771#[doc = "List of possible units where failures can be injected."]
772pub enum FailureUnit {
773 FAILURE_UNIT_SENSOR_GYRO = 0,
774 FAILURE_UNIT_SENSOR_ACCEL = 1,
775 FAILURE_UNIT_SENSOR_MAG = 2,
776 FAILURE_UNIT_SENSOR_BARO = 3,
777 FAILURE_UNIT_SENSOR_GPS = 4,
778 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
779 FAILURE_UNIT_SENSOR_VIO = 6,
780 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
781 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
782 FAILURE_UNIT_SYSTEM_BATTERY = 100,
783 FAILURE_UNIT_SYSTEM_MOTOR = 101,
784 FAILURE_UNIT_SYSTEM_SERVO = 102,
785 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
786 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
787 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
788}
789impl FailureUnit {
790 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
791}
792impl Default for FailureUnit {
793 fn default() -> Self {
794 Self::DEFAULT
795 }
796}
797#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
799#[cfg_attr(feature = "serde", serde(tag = "type"))]
800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
801#[repr(u32)]
802pub enum FenceBreach {
803 #[doc = "No last fence breach"]
804 FENCE_BREACH_NONE = 0,
805 #[doc = "Breached minimum altitude"]
806 FENCE_BREACH_MINALT = 1,
807 #[doc = "Breached maximum altitude"]
808 FENCE_BREACH_MAXALT = 2,
809 #[doc = "Breached fence boundary"]
810 FENCE_BREACH_BOUNDARY = 3,
811}
812impl FenceBreach {
813 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
814}
815impl Default for FenceBreach {
816 fn default() -> Self {
817 Self::DEFAULT
818 }
819}
820#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
822#[cfg_attr(feature = "serde", serde(tag = "type"))]
823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
824#[repr(u32)]
825#[doc = "Actions being taken to mitigate/prevent fence breach"]
826pub enum FenceMitigate {
827 #[doc = "Unknown"]
828 FENCE_MITIGATE_UNKNOWN = 0,
829 #[doc = "No actions being taken"]
830 FENCE_MITIGATE_NONE = 1,
831 #[doc = "Velocity limiting active to prevent breach"]
832 FENCE_MITIGATE_VEL_LIMIT = 2,
833}
834impl FenceMitigate {
835 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
836}
837impl Default for FenceMitigate {
838 fn default() -> Self {
839 Self::DEFAULT
840 }
841}
842#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
844#[cfg_attr(feature = "serde", serde(tag = "type"))]
845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
846#[repr(u32)]
847#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
848pub enum FenceType {
849 #[doc = "Maximum altitude fence"]
850 FENCE_TYPE_ALT_MAX = 1,
851 #[doc = "Circle fence"]
852 FENCE_TYPE_CIRCLE = 2,
853 #[doc = "Polygon fence"]
854 FENCE_TYPE_POLYGON = 4,
855 #[doc = "Minimum altitude fence"]
856 FENCE_TYPE_ALT_MIN = 8,
857}
858impl FenceType {
859 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
860}
861impl Default for FenceType {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
868#[cfg_attr(feature = "serde", serde(tag = "type"))]
869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
870#[repr(u32)]
871#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
872pub enum FirmwareVersionType {
873 #[doc = "development release"]
874 FIRMWARE_VERSION_TYPE_DEV = 0,
875 #[doc = "alpha release"]
876 FIRMWARE_VERSION_TYPE_ALPHA = 64,
877 #[doc = "beta release"]
878 FIRMWARE_VERSION_TYPE_BETA = 128,
879 #[doc = "release candidate"]
880 FIRMWARE_VERSION_TYPE_RC = 192,
881 #[doc = "official stable release"]
882 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
883}
884impl FirmwareVersionType {
885 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
886}
887impl Default for FirmwareVersionType {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
893impl GimbalDeviceCapFlags {
894 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
895}
896impl Default for GimbalDeviceCapFlags {
897 fn default() -> Self {
898 Self::DEFAULT
899 }
900}
901bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
902impl GimbalDeviceErrorFlags {
903 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
904}
905impl Default for GimbalDeviceErrorFlags {
906 fn default() -> Self {
907 Self::DEFAULT
908 }
909}
910bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
911impl GimbalDeviceFlags {
912 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
913}
914impl Default for GimbalDeviceFlags {
915 fn default() -> Self {
916 Self::DEFAULT
917 }
918}
919bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
920impl GimbalManagerCapFlags {
921 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
922}
923impl Default for GimbalManagerCapFlags {
924 fn default() -> Self {
925 Self::DEFAULT
926 }
927}
928bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
929impl GimbalManagerFlags {
930 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
931}
932impl Default for GimbalManagerFlags {
933 fn default() -> Self {
934 Self::DEFAULT
935 }
936}
937#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
939#[cfg_attr(feature = "serde", serde(tag = "type"))]
940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
941#[repr(u32)]
942#[doc = "Type of GPS fix"]
943pub enum GpsFixType {
944 #[doc = "No GPS connected"]
945 GPS_FIX_TYPE_NO_GPS = 0,
946 #[doc = "No position information, GPS is connected"]
947 GPS_FIX_TYPE_NO_FIX = 1,
948 #[doc = "2D position"]
949 GPS_FIX_TYPE_2D_FIX = 2,
950 #[doc = "3D position"]
951 GPS_FIX_TYPE_3D_FIX = 3,
952 #[doc = "DGPS/SBAS aided 3D position"]
953 GPS_FIX_TYPE_DGPS = 4,
954 #[doc = "RTK float, 3D position"]
955 GPS_FIX_TYPE_RTK_FLOAT = 5,
956 #[doc = "RTK Fixed, 3D position"]
957 GPS_FIX_TYPE_RTK_FIXED = 6,
958 #[doc = "Static fixed, typically used for base stations"]
959 GPS_FIX_TYPE_STATIC = 7,
960 #[doc = "PPP, 3D position."]
961 GPS_FIX_TYPE_PPP = 8,
962}
963impl GpsFixType {
964 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
965}
966impl Default for GpsFixType {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
972impl GpsInputIgnoreFlags {
973 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
974}
975impl Default for GpsInputIgnoreFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
982#[cfg_attr(feature = "serde", serde(tag = "type"))]
983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
984#[repr(u32)]
985#[doc = "Gripper actions."]
986pub enum GripperActions {
987 #[doc = "Gripper release cargo."]
988 GRIPPER_ACTION_RELEASE = 0,
989 #[doc = "Gripper grab onto cargo."]
990 GRIPPER_ACTION_GRAB = 1,
991}
992impl GripperActions {
993 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
994}
995impl Default for GripperActions {
996 fn default() -> Self {
997 Self::DEFAULT
998 }
999}
1000#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1002#[cfg_attr(feature = "serde", serde(tag = "type"))]
1003#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1004#[repr(u32)]
1005pub enum GsmLinkType {
1006 #[doc = "no service"]
1007 GSM_LINK_TYPE_NONE = 0,
1008 #[doc = "link type unknown"]
1009 GSM_LINK_TYPE_UNKNOWN = 1,
1010 #[doc = "2G (GSM/GRPS/EDGE) link"]
1011 GSM_LINK_TYPE_2G = 2,
1012 #[doc = "3G link (WCDMA/HSDPA/HSPA)"]
1013 GSM_LINK_TYPE_3G = 3,
1014 #[doc = "4G link (LTE)"]
1015 GSM_LINK_TYPE_4G = 4,
1016}
1017impl GsmLinkType {
1018 pub const DEFAULT: Self = Self::GSM_LINK_TYPE_NONE;
1019}
1020impl Default for GsmLinkType {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1027#[cfg_attr(feature = "serde", serde(tag = "type"))]
1028#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1029#[repr(u32)]
1030pub enum GsmModemType {
1031 #[doc = "not specified"]
1032 GSM_MODEM_TYPE_UNKNOWN = 0,
1033 #[doc = "HUAWEI LTE USB Stick E3372"]
1034 GSM_MODEM_TYPE_HUAWEI_E3372 = 1,
1035}
1036impl GsmModemType {
1037 pub const DEFAULT: Self = Self::GSM_MODEM_TYPE_UNKNOWN;
1038}
1039impl Default for GsmModemType {
1040 fn default() -> Self {
1041 Self::DEFAULT
1042 }
1043}
1044bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1045impl HighresImuUpdatedFlags {
1046 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1047}
1048impl Default for HighresImuUpdatedFlags {
1049 fn default() -> Self {
1050 Self::DEFAULT
1051 }
1052}
1053bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1054impl HilActuatorControlsFlags {
1055 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1056}
1057impl Default for HilActuatorControlsFlags {
1058 fn default() -> Self {
1059 Self::DEFAULT
1060 }
1061}
1062bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1063impl HilSensorUpdatedFlags {
1064 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1065}
1066impl Default for HilSensorUpdatedFlags {
1067 fn default() -> Self {
1068 Self::DEFAULT
1069 }
1070}
1071bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1072impl HlFailureFlag {
1073 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1074}
1075impl Default for HlFailureFlag {
1076 fn default() -> Self {
1077 Self::DEFAULT
1078 }
1079}
1080bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1081impl IlluminatorErrorFlags {
1082 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1083}
1084impl Default for IlluminatorErrorFlags {
1085 fn default() -> Self {
1086 Self::DEFAULT
1087 }
1088}
1089#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1091#[cfg_attr(feature = "serde", serde(tag = "type"))]
1092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1093#[repr(u32)]
1094#[doc = "Modes of illuminator"]
1095pub enum IlluminatorMode {
1096 #[doc = "Illuminator mode is not specified/unknown"]
1097 ILLUMINATOR_MODE_UNKNOWN = 0,
1098 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1099 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1100 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1101 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1102}
1103impl IlluminatorMode {
1104 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1105}
1106impl Default for IlluminatorMode {
1107 fn default() -> Self {
1108 Self::DEFAULT
1109 }
1110}
1111#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1112#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1113#[cfg_attr(feature = "serde", serde(tag = "type"))]
1114#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1115#[repr(u32)]
1116#[doc = "Type of landing target"]
1117pub enum LandingTargetType {
1118 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1119 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1120 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1121 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1122 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1123 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1124 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1125 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1126}
1127impl LandingTargetType {
1128 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1129}
1130impl Default for LandingTargetType {
1131 fn default() -> Self {
1132 Self::DEFAULT
1133 }
1134}
1135#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1137#[cfg_attr(feature = "serde", serde(tag = "type"))]
1138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1139#[repr(u32)]
1140pub enum MagCalStatus {
1141 MAG_CAL_NOT_STARTED = 0,
1142 MAG_CAL_WAITING_TO_START = 1,
1143 MAG_CAL_RUNNING_STEP_ONE = 2,
1144 MAG_CAL_RUNNING_STEP_TWO = 3,
1145 MAG_CAL_SUCCESS = 4,
1146 MAG_CAL_FAILED = 5,
1147 MAG_CAL_BAD_ORIENTATION = 6,
1148 MAG_CAL_BAD_RADIUS = 7,
1149}
1150impl MagCalStatus {
1151 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1152}
1153impl Default for MagCalStatus {
1154 fn default() -> Self {
1155 Self::DEFAULT
1156 }
1157}
1158#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1159#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1160#[cfg_attr(feature = "serde", serde(tag = "type"))]
1161#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1162#[repr(u32)]
1163pub enum MavArmAuthDeniedReason {
1164 #[doc = "Not a specific reason"]
1165 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1166 #[doc = "Authorizer will send the error as string to GCS"]
1167 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1168 #[doc = "At least one waypoint have a invalid value"]
1169 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1170 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1171 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1172 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1173 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1174 #[doc = "Weather is not good to fly"]
1175 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1176}
1177impl MavArmAuthDeniedReason {
1178 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1179}
1180impl Default for MavArmAuthDeniedReason {
1181 fn default() -> Self {
1182 Self::DEFAULT
1183 }
1184}
1185#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1187#[cfg_attr(feature = "serde", serde(tag = "type"))]
1188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1189#[repr(u32)]
1190#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1191pub enum MavAutopilot {
1192 #[doc = "Generic autopilot, full support for everything"]
1193 MAV_AUTOPILOT_GENERIC = 0,
1194 #[doc = "Reserved for future use."]
1195 MAV_AUTOPILOT_RESERVED = 1,
1196 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1197 MAV_AUTOPILOT_SLUGS = 2,
1198 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1199 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1200 #[doc = "OpenPilot, <http://openpilot.org>"]
1201 MAV_AUTOPILOT_OPENPILOT = 4,
1202 #[doc = "Generic autopilot only supporting simple waypoints"]
1203 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1204 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1205 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1206 #[doc = "Generic autopilot supporting the full mission command set"]
1207 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1208 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1209 MAV_AUTOPILOT_INVALID = 8,
1210 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1211 MAV_AUTOPILOT_PPZ = 9,
1212 #[doc = "UAV Dev Board"]
1213 MAV_AUTOPILOT_UDB = 10,
1214 #[doc = "FlexiPilot"]
1215 MAV_AUTOPILOT_FP = 11,
1216 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1217 MAV_AUTOPILOT_PX4 = 12,
1218 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1219 MAV_AUTOPILOT_SMACCMPILOT = 13,
1220 #[doc = "AutoQuad -- <http://autoquad.org>"]
1221 MAV_AUTOPILOT_AUTOQUAD = 14,
1222 #[doc = "Armazila -- <http://armazila.com>"]
1223 MAV_AUTOPILOT_ARMAZILA = 15,
1224 #[doc = "Aerob -- <http://aerob.ru>"]
1225 MAV_AUTOPILOT_AEROB = 16,
1226 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1227 MAV_AUTOPILOT_ASLUAV = 17,
1228 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1229 MAV_AUTOPILOT_SMARTAP = 18,
1230 #[doc = "AirRails - <http://uaventure.com>"]
1231 MAV_AUTOPILOT_AIRRAILS = 19,
1232 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1233 MAV_AUTOPILOT_REFLEX = 20,
1234}
1235impl MavAutopilot {
1236 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1237}
1238impl Default for MavAutopilot {
1239 fn default() -> Self {
1240 Self::DEFAULT
1241 }
1242}
1243#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1244#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1245#[cfg_attr(feature = "serde", serde(tag = "type"))]
1246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1247#[repr(u32)]
1248#[doc = "Enumeration for battery charge states."]
1249pub enum MavBatteryChargeState {
1250 #[doc = "Low battery state is not provided"]
1251 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1252 #[doc = "Battery is not in low state. Normal operation."]
1253 MAV_BATTERY_CHARGE_STATE_OK = 1,
1254 #[doc = "Battery state is low, warn and monitor close."]
1255 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1256 #[doc = "Battery state is critical, return or abort immediately."]
1257 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1258 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1259 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1260 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1261 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1262 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1263 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1264 #[doc = "Battery is charging."]
1265 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1266}
1267impl MavBatteryChargeState {
1268 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1269}
1270impl Default for MavBatteryChargeState {
1271 fn default() -> Self {
1272 Self::DEFAULT
1273 }
1274}
1275bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1276impl MavBatteryFault {
1277 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1278}
1279impl Default for MavBatteryFault {
1280 fn default() -> Self {
1281 Self::DEFAULT
1282 }
1283}
1284#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1286#[cfg_attr(feature = "serde", serde(tag = "type"))]
1287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1288#[repr(u32)]
1289#[doc = "Enumeration of battery functions"]
1290pub enum MavBatteryFunction {
1291 #[doc = "Battery function is unknown"]
1292 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1293 #[doc = "Battery supports all flight systems"]
1294 MAV_BATTERY_FUNCTION_ALL = 1,
1295 #[doc = "Battery for the propulsion system"]
1296 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1297 #[doc = "Avionics battery"]
1298 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1299 #[doc = "Payload battery"]
1300 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1301}
1302impl MavBatteryFunction {
1303 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1304}
1305impl Default for MavBatteryFunction {
1306 fn default() -> Self {
1307 Self::DEFAULT
1308 }
1309}
1310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1312#[cfg_attr(feature = "serde", serde(tag = "type"))]
1313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1314#[repr(u32)]
1315#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1316pub enum MavBatteryMode {
1317 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1318 MAV_BATTERY_MODE_UNKNOWN = 0,
1319 #[doc = "Battery is auto discharging (towards storage level)."]
1320 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1321 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1322 MAV_BATTERY_MODE_HOT_SWAP = 2,
1323}
1324impl MavBatteryMode {
1325 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1326}
1327impl Default for MavBatteryMode {
1328 fn default() -> Self {
1329 Self::DEFAULT
1330 }
1331}
1332#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1334#[cfg_attr(feature = "serde", serde(tag = "type"))]
1335#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1336#[repr(u32)]
1337#[doc = "Enumeration of battery types"]
1338pub enum MavBatteryType {
1339 #[doc = "Not specified."]
1340 MAV_BATTERY_TYPE_UNKNOWN = 0,
1341 #[doc = "Lithium polymer battery"]
1342 MAV_BATTERY_TYPE_LIPO = 1,
1343 #[doc = "Lithium-iron-phosphate battery"]
1344 MAV_BATTERY_TYPE_LIFE = 2,
1345 #[doc = "Lithium-ION battery"]
1346 MAV_BATTERY_TYPE_LION = 3,
1347 #[doc = "Nickel metal hydride battery"]
1348 MAV_BATTERY_TYPE_NIMH = 4,
1349}
1350impl MavBatteryType {
1351 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1352}
1353impl Default for MavBatteryType {
1354 fn default() -> Self {
1355 Self::DEFAULT
1356 }
1357}
1358#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1359#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1360#[cfg_attr(feature = "serde", serde(tag = "type"))]
1361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1362#[repr(u32)]
1363#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1364pub enum MavCmd {
1365 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1366 MAV_CMD_NAV_WAYPOINT = 16,
1367 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1368 MAV_CMD_NAV_LOITER_UNLIM = 17,
1369 #[doc = "Loiter around this waypoint for X turns"]
1370 MAV_CMD_NAV_LOITER_TURNS = 18,
1371 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1372 MAV_CMD_NAV_LOITER_TIME = 19,
1373 #[doc = "Return to launch location"]
1374 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1375 #[doc = "Land at location."]
1376 MAV_CMD_NAV_LAND = 21,
1377 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1378 MAV_CMD_NAV_TAKEOFF = 22,
1379 #[doc = "Land at local position (local frame only)"]
1380 MAV_CMD_NAV_LAND_LOCAL = 23,
1381 #[doc = "Takeoff from local position (local frame only)"]
1382 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1383 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1384 MAV_CMD_NAV_FOLLOW = 25,
1385 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1386 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1387 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1388 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1389 #[doc = "Begin following a target"]
1390 MAV_CMD_DO_FOLLOW = 32,
1391 #[doc = "Reposition the MAV after a follow target command has been sent"]
1392 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1393 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1394 MAV_CMD_DO_ORBIT = 34,
1395 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1396 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1397 MAV_CMD_NAV_ROI = 80,
1398 #[doc = "Control autonomous path planning on the MAV."]
1399 MAV_CMD_NAV_PATHPLANNING = 81,
1400 #[doc = "Navigate to waypoint using a spline path."]
1401 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1402 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1403 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1404 #[doc = "Land using VTOL mode"]
1405 MAV_CMD_NAV_VTOL_LAND = 85,
1406 #[doc = "hand control over to an external controller"]
1407 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1408 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1409 MAV_CMD_NAV_DELAY = 93,
1410 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1411 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1412 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1413 MAV_CMD_NAV_LAST = 95,
1414 #[doc = "Delay mission state machine."]
1415 MAV_CMD_CONDITION_DELAY = 112,
1416 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1417 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1418 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1419 MAV_CMD_CONDITION_DISTANCE = 114,
1420 #[doc = "Reach a certain target angle."]
1421 MAV_CMD_CONDITION_YAW = 115,
1422 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1423 MAV_CMD_CONDITION_LAST = 159,
1424 #[doc = "Set system mode."]
1425 MAV_CMD_DO_SET_MODE = 176,
1426 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1427 MAV_CMD_DO_JUMP = 177,
1428 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1429 MAV_CMD_DO_CHANGE_SPEED = 178,
1430 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1431 MAV_CMD_DO_SET_HOME = 179,
1432 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1433 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1434 MAV_CMD_DO_SET_PARAMETER = 180,
1435 #[doc = "Set a relay to a condition."]
1436 MAV_CMD_DO_SET_RELAY = 181,
1437 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1438 MAV_CMD_DO_REPEAT_RELAY = 182,
1439 #[doc = "Set a servo to a desired PWM value."]
1440 MAV_CMD_DO_SET_SERVO = 183,
1441 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1442 MAV_CMD_DO_REPEAT_SERVO = 184,
1443 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1444 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1445 #[doc = "Change altitude set point."]
1446 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1447 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1448 MAV_CMD_DO_SET_ACTUATOR = 187,
1449 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1450 MAV_CMD_DO_RETURN_PATH_START = 188,
1451 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1452 MAV_CMD_DO_LAND_START = 189,
1453 #[doc = "Mission command to perform a landing from a rally point."]
1454 MAV_CMD_DO_RALLY_LAND = 190,
1455 #[doc = "Mission command to safely abort an autonomous landing."]
1456 MAV_CMD_DO_GO_AROUND = 191,
1457 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1458 MAV_CMD_DO_REPOSITION = 192,
1459 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1460 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1461 #[doc = "Set moving direction to forward or reverse."]
1462 MAV_CMD_DO_SET_REVERSE = 194,
1463 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1464 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1465 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1466 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1467 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1468 MAV_CMD_DO_SET_ROI_NONE = 197,
1469 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1470 MAV_CMD_DO_SET_ROI_SYSID = 198,
1471 #[doc = "Control onboard camera system."]
1472 MAV_CMD_DO_CONTROL_VIDEO = 200,
1473 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1474 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1475 MAV_CMD_DO_SET_ROI = 201,
1476 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1477 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1478 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1479 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1480 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1481 #[doc = "Mission command to configure a camera or antenna mount"]
1482 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1483 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1484 #[doc = "Mission command to control a camera or antenna mount"]
1485 MAV_CMD_DO_MOUNT_CONTROL = 205,
1486 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1487 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1488 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1489 MAV_CMD_DO_FENCE_ENABLE = 207,
1490 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1491 MAV_CMD_DO_PARACHUTE = 208,
1492 #[doc = "Command to perform motor test."]
1493 MAV_CMD_DO_MOTOR_TEST = 209,
1494 #[doc = "Change to/from inverted flight."]
1495 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1496 #[doc = "Mission command to operate a gripper."]
1497 MAV_CMD_DO_GRIPPER = 211,
1498 #[doc = "Enable/disable autotune."]
1499 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1500 #[doc = "Sets a desired vehicle turn angle and speed change."]
1501 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1502 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1503 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1504 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1505 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1506 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1507 #[doc = "set id of master controller"]
1508 MAV_CMD_DO_GUIDED_MASTER = 221,
1509 #[doc = "Set limits for external control"]
1510 MAV_CMD_DO_GUIDED_LIMITS = 222,
1511 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1512 MAV_CMD_DO_ENGINE_CONTROL = 223,
1513 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1514 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1515 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1516 MAV_CMD_DO_LAST = 240,
1517 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1518 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1519 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1520 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1521 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1522 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1523 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1524 MAV_CMD_PREFLIGHT_STORAGE = 245,
1525 #[doc = "Request the reboot or shutdown of system components."]
1526 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1527 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1528 MAV_CMD_OVERRIDE_GOTO = 252,
1529 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1530 MAV_CMD_OBLIQUE_SURVEY = 260,
1531 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1532 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1533 #[doc = "start running a mission"]
1534 MAV_CMD_MISSION_START = 300,
1535 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1536 MAV_CMD_ACTUATOR_TEST = 310,
1537 #[doc = "Actuator configuration command."]
1538 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1539 #[doc = "Arms / Disarms a component"]
1540 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1541 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1542 MAV_CMD_RUN_PREARM_CHECKS = 401,
1543 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1544 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1545 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1546 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1547 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1548 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1549 MAV_CMD_GET_HOME_POSITION = 410,
1550 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1551 MAV_CMD_INJECT_FAILURE = 420,
1552 #[doc = "Starts receiver pairing."]
1553 MAV_CMD_START_RX_PAIR = 500,
1554 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1555 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1556 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1557 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1558 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1559 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1560 MAV_CMD_REQUEST_MESSAGE = 512,
1561 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1562 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1563 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1564 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1565 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1566 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1567 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1568 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1569 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1570 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1571 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1572 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1573 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1574 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1575 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1576 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1577 MAV_CMD_STORAGE_FORMAT = 526,
1578 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1579 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1580 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1581 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1582 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1583 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1584 #[doc = "Reset all camera settings to Factory Default"]
1585 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1586 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1587 MAV_CMD_SET_CAMERA_MODE = 530,
1588 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1589 MAV_CMD_SET_CAMERA_ZOOM = 531,
1590 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1591 MAV_CMD_SET_CAMERA_FOCUS = 532,
1592 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1593 MAV_CMD_SET_STORAGE_USAGE = 533,
1594 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1595 MAV_CMD_SET_CAMERA_SOURCE = 534,
1596 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1597 MAV_CMD_JUMP_TAG = 600,
1598 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1599 MAV_CMD_DO_JUMP_TAG = 601,
1600 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1601 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1602 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1603 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1604 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1605 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1606 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1607 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1608 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1609 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1610 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1611 #[doc = "Enable or disable on-board camera triggering system."]
1612 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1613 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1614 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1615 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1616 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1617 #[doc = "Stops ongoing tracking."]
1618 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1619 #[doc = "Starts video capture (recording)."]
1620 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1621 #[doc = "Stop the current video capture (recording)."]
1622 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1623 #[doc = "Start video streaming"]
1624 MAV_CMD_VIDEO_START_STREAMING = 2502,
1625 #[doc = "Stop the given video stream"]
1626 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1627 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1628 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1629 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1630 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1631 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1632 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1633 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1634 MAV_CMD_LOGGING_START = 2510,
1635 #[doc = "Request to stop streaming log data over MAVLink"]
1636 MAV_CMD_LOGGING_STOP = 2511,
1637 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1638 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1639 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1640 #[doc = "Create a panorama at the current position"]
1641 MAV_CMD_PANORAMA_CREATE = 2800,
1642 #[doc = "Request VTOL transition"]
1643 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1644 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1645 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1646 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1647 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1648 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1649 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1650 #[doc = "Delay mission state machine until gate has been reached."]
1651 MAV_CMD_CONDITION_GATE = 4501,
1652 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1653 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1654 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1655 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1656 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1657 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1658 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1659 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1660 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1661 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1662 #[doc = "Rally point. You can have multiple rally points defined."]
1663 MAV_CMD_NAV_RALLY_POINT = 5100,
1664 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1665 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1666 #[doc = "Change state of safety switch."]
1667 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1668 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1669 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1670 #[deprecated = " (Deprecated since 2021-06)"]
1671 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1672 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1673 #[deprecated = " (Deprecated since 2021-06)"]
1674 #[doc = "Control the payload deployment."]
1675 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1676 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1677 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1678 #[doc = "Command to operate winch."]
1679 MAV_CMD_DO_WINCH = 42600,
1680 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1681 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1682 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1683 MAV_CMD_WAYPOINT_USER_1 = 31000,
1684 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1685 MAV_CMD_WAYPOINT_USER_2 = 31001,
1686 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1687 MAV_CMD_WAYPOINT_USER_3 = 31002,
1688 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1689 MAV_CMD_WAYPOINT_USER_4 = 31003,
1690 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1691 MAV_CMD_WAYPOINT_USER_5 = 31004,
1692 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1693 MAV_CMD_SPATIAL_USER_1 = 31005,
1694 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1695 MAV_CMD_SPATIAL_USER_2 = 31006,
1696 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1697 MAV_CMD_SPATIAL_USER_3 = 31007,
1698 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1699 MAV_CMD_SPATIAL_USER_4 = 31008,
1700 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1701 MAV_CMD_SPATIAL_USER_5 = 31009,
1702 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1703 MAV_CMD_USER_1 = 31010,
1704 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1705 MAV_CMD_USER_2 = 31011,
1706 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1707 MAV_CMD_USER_3 = 31012,
1708 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1709 MAV_CMD_USER_4 = 31013,
1710 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1711 MAV_CMD_USER_5 = 31014,
1712 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1713 MAV_CMD_CAN_FORWARD = 32000,
1714 #[doc = "Mission command to reset Maximum Power Point Tracker (MPPT)"]
1715 MAV_CMD_RESET_MPPT = 40001,
1716 #[doc = "Mission command to perform a power cycle on payload"]
1717 MAV_CMD_PAYLOAD_CONTROL = 40002,
1718}
1719impl MavCmd {
1720 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1721}
1722impl Default for MavCmd {
1723 fn default() -> Self {
1724 Self::DEFAULT
1725 }
1726}
1727#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1729#[cfg_attr(feature = "serde", serde(tag = "type"))]
1730#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1731#[repr(u32)]
1732#[doc = "Possible actions an aircraft can take to avoid a collision."]
1733pub enum MavCollisionAction {
1734 #[doc = "Ignore any potential collisions"]
1735 MAV_COLLISION_ACTION_NONE = 0,
1736 #[doc = "Report potential collision"]
1737 MAV_COLLISION_ACTION_REPORT = 1,
1738 #[doc = "Ascend or Descend to avoid threat"]
1739 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1740 #[doc = "Move horizontally to avoid threat"]
1741 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1742 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1743 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1744 #[doc = "Aircraft to fly directly back to its launch point"]
1745 MAV_COLLISION_ACTION_RTL = 5,
1746 #[doc = "Aircraft to stop in place"]
1747 MAV_COLLISION_ACTION_HOVER = 6,
1748}
1749impl MavCollisionAction {
1750 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1751}
1752impl Default for MavCollisionAction {
1753 fn default() -> Self {
1754 Self::DEFAULT
1755 }
1756}
1757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1759#[cfg_attr(feature = "serde", serde(tag = "type"))]
1760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1761#[repr(u32)]
1762#[doc = "Source of information about this collision."]
1763pub enum MavCollisionSrc {
1764 #[doc = "ID field references ADSB_VEHICLE packets"]
1765 MAV_COLLISION_SRC_ADSB = 0,
1766 #[doc = "ID field references MAVLink SRC ID"]
1767 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1768}
1769impl MavCollisionSrc {
1770 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1771}
1772impl Default for MavCollisionSrc {
1773 fn default() -> Self {
1774 Self::DEFAULT
1775 }
1776}
1777#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1779#[cfg_attr(feature = "serde", serde(tag = "type"))]
1780#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1781#[repr(u32)]
1782#[doc = "Aircraft-rated danger from this threat."]
1783pub enum MavCollisionThreatLevel {
1784 #[doc = "Not a threat"]
1785 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1786 #[doc = "Craft is mildly concerned about this threat"]
1787 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1788 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1789 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1790}
1791impl MavCollisionThreatLevel {
1792 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1793}
1794impl Default for MavCollisionThreatLevel {
1795 fn default() -> Self {
1796 Self::DEFAULT
1797 }
1798}
1799#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1800#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1801#[cfg_attr(feature = "serde", serde(tag = "type"))]
1802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1803#[repr(u32)]
1804#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1805pub enum MavComponent {
1806 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1807 MAV_COMP_ID_ALL = 0,
1808 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1809 MAV_COMP_ID_AUTOPILOT1 = 1,
1810 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1811 MAV_COMP_ID_USER1 = 25,
1812 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1813 MAV_COMP_ID_USER2 = 26,
1814 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1815 MAV_COMP_ID_USER3 = 27,
1816 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1817 MAV_COMP_ID_USER4 = 28,
1818 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1819 MAV_COMP_ID_USER5 = 29,
1820 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1821 MAV_COMP_ID_USER6 = 30,
1822 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1823 MAV_COMP_ID_USER7 = 31,
1824 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1825 MAV_COMP_ID_USER8 = 32,
1826 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1827 MAV_COMP_ID_USER9 = 33,
1828 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1829 MAV_COMP_ID_USER10 = 34,
1830 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1831 MAV_COMP_ID_USER11 = 35,
1832 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1833 MAV_COMP_ID_USER12 = 36,
1834 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1835 MAV_COMP_ID_USER13 = 37,
1836 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1837 MAV_COMP_ID_USER14 = 38,
1838 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1839 MAV_COMP_ID_USER15 = 39,
1840 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1841 MAV_COMP_ID_USER16 = 40,
1842 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1843 MAV_COMP_ID_USER17 = 41,
1844 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1845 MAV_COMP_ID_USER18 = 42,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER19 = 43,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER20 = 44,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER21 = 45,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER22 = 46,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER23 = 47,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER24 = 48,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER25 = 49,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER26 = 50,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER27 = 51,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER28 = 52,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER29 = 53,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER30 = 54,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER31 = 55,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER32 = 56,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER33 = 57,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER34 = 58,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER35 = 59,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER36 = 60,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER37 = 61,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER38 = 62,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER39 = 63,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER40 = 64,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER41 = 65,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER42 = 66,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER43 = 67,
1896 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1897 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER45 = 69,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER46 = 70,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER47 = 71,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER48 = 72,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER49 = 73,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER50 = 74,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER51 = 75,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER52 = 76,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER53 = 77,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER54 = 78,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER55 = 79,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER56 = 80,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER57 = 81,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER58 = 82,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER59 = 83,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER60 = 84,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER61 = 85,
1932 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1933 MAV_COMP_ID_USER62 = 86,
1934 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1935 MAV_COMP_ID_USER63 = 87,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER64 = 88,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER65 = 89,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER66 = 90,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER67 = 91,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER68 = 92,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER69 = 93,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER70 = 94,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER71 = 95,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER72 = 96,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER73 = 97,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER74 = 98,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER75 = 99,
1960 #[doc = "Camera #1."]
1961 MAV_COMP_ID_CAMERA = 100,
1962 #[doc = "Camera #2."]
1963 MAV_COMP_ID_CAMERA2 = 101,
1964 #[doc = "Camera #3."]
1965 MAV_COMP_ID_CAMERA3 = 102,
1966 #[doc = "Camera #4."]
1967 MAV_COMP_ID_CAMERA4 = 103,
1968 #[doc = "Camera #5."]
1969 MAV_COMP_ID_CAMERA5 = 104,
1970 #[doc = "Camera #6."]
1971 MAV_COMP_ID_CAMERA6 = 105,
1972 #[doc = "Servo #1."]
1973 MAV_COMP_ID_SERVO1 = 140,
1974 #[doc = "Servo #2."]
1975 MAV_COMP_ID_SERVO2 = 141,
1976 #[doc = "Servo #3."]
1977 MAV_COMP_ID_SERVO3 = 142,
1978 #[doc = "Servo #4."]
1979 MAV_COMP_ID_SERVO4 = 143,
1980 #[doc = "Servo #5."]
1981 MAV_COMP_ID_SERVO5 = 144,
1982 #[doc = "Servo #6."]
1983 MAV_COMP_ID_SERVO6 = 145,
1984 #[doc = "Servo #7."]
1985 MAV_COMP_ID_SERVO7 = 146,
1986 #[doc = "Servo #8."]
1987 MAV_COMP_ID_SERVO8 = 147,
1988 #[doc = "Servo #9."]
1989 MAV_COMP_ID_SERVO9 = 148,
1990 #[doc = "Servo #10."]
1991 MAV_COMP_ID_SERVO10 = 149,
1992 #[doc = "Servo #11."]
1993 MAV_COMP_ID_SERVO11 = 150,
1994 #[doc = "Servo #12."]
1995 MAV_COMP_ID_SERVO12 = 151,
1996 #[doc = "Servo #13."]
1997 MAV_COMP_ID_SERVO13 = 152,
1998 #[doc = "Servo #14."]
1999 MAV_COMP_ID_SERVO14 = 153,
2000 #[doc = "Gimbal #1."]
2001 MAV_COMP_ID_GIMBAL = 154,
2002 #[doc = "Logging component."]
2003 MAV_COMP_ID_LOG = 155,
2004 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2005 MAV_COMP_ID_ADSB = 156,
2006 #[doc = "On Screen Display (OSD) devices for video links."]
2007 MAV_COMP_ID_OSD = 157,
2008 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2009 MAV_COMP_ID_PERIPHERAL = 158,
2010 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2011 #[doc = "Gimbal ID for QX1."]
2012 MAV_COMP_ID_QX1_GIMBAL = 159,
2013 #[doc = "FLARM collision alert component."]
2014 MAV_COMP_ID_FLARM = 160,
2015 #[doc = "Parachute component."]
2016 MAV_COMP_ID_PARACHUTE = 161,
2017 #[doc = "Winch component."]
2018 MAV_COMP_ID_WINCH = 169,
2019 #[doc = "Gimbal #2."]
2020 MAV_COMP_ID_GIMBAL2 = 171,
2021 #[doc = "Gimbal #3."]
2022 MAV_COMP_ID_GIMBAL3 = 172,
2023 #[doc = "Gimbal #4"]
2024 MAV_COMP_ID_GIMBAL4 = 173,
2025 #[doc = "Gimbal #5."]
2026 MAV_COMP_ID_GIMBAL5 = 174,
2027 #[doc = "Gimbal #6."]
2028 MAV_COMP_ID_GIMBAL6 = 175,
2029 #[doc = "Battery #1."]
2030 MAV_COMP_ID_BATTERY = 180,
2031 #[doc = "Battery #2."]
2032 MAV_COMP_ID_BATTERY2 = 181,
2033 #[doc = "CAN over MAVLink client."]
2034 MAV_COMP_ID_MAVCAN = 189,
2035 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2036 MAV_COMP_ID_MISSIONPLANNER = 190,
2037 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2038 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2039 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2040 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2041 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2042 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2043 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2044 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2045 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2046 MAV_COMP_ID_PATHPLANNER = 195,
2047 #[doc = "Component that plans a collision free path between two points."]
2048 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2049 #[doc = "Component that provides position estimates using VIO techniques."]
2050 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2051 #[doc = "Component that manages pairing of vehicle and GCS."]
2052 MAV_COMP_ID_PAIRING_MANAGER = 198,
2053 #[doc = "Inertial Measurement Unit (IMU) #1."]
2054 MAV_COMP_ID_IMU = 200,
2055 #[doc = "Inertial Measurement Unit (IMU) #2."]
2056 MAV_COMP_ID_IMU_2 = 201,
2057 #[doc = "Inertial Measurement Unit (IMU) #3."]
2058 MAV_COMP_ID_IMU_3 = 202,
2059 #[doc = "GPS #1."]
2060 MAV_COMP_ID_GPS = 220,
2061 #[doc = "GPS #2."]
2062 MAV_COMP_ID_GPS2 = 221,
2063 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2064 MAV_COMP_ID_ODID_TXRX_1 = 236,
2065 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2066 MAV_COMP_ID_ODID_TXRX_2 = 237,
2067 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2068 MAV_COMP_ID_ODID_TXRX_3 = 238,
2069 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2070 MAV_COMP_ID_UDP_BRIDGE = 240,
2071 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2072 MAV_COMP_ID_UART_BRIDGE = 241,
2073 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2074 MAV_COMP_ID_TUNNEL_NODE = 242,
2075 #[doc = "Illuminator"]
2076 MAV_COMP_ID_ILLUMINATOR = 243,
2077 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2078 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2079 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2080}
2081impl MavComponent {
2082 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2083}
2084impl Default for MavComponent {
2085 fn default() -> Self {
2086 Self::DEFAULT
2087 }
2088}
2089#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2091#[cfg_attr(feature = "serde", serde(tag = "type"))]
2092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2093#[repr(u32)]
2094#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2095#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2096pub enum MavDataStream {
2097 #[doc = "Enable all data streams"]
2098 MAV_DATA_STREAM_ALL = 0,
2099 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2100 MAV_DATA_STREAM_RAW_SENSORS = 1,
2101 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2102 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2103 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2104 MAV_DATA_STREAM_RC_CHANNELS = 3,
2105 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2106 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2107 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2108 MAV_DATA_STREAM_POSITION = 6,
2109 #[doc = "Dependent on the autopilot"]
2110 MAV_DATA_STREAM_EXTRA1 = 10,
2111 #[doc = "Dependent on the autopilot"]
2112 MAV_DATA_STREAM_EXTRA2 = 11,
2113 #[doc = "Dependent on the autopilot"]
2114 MAV_DATA_STREAM_EXTRA3 = 12,
2115}
2116impl MavDataStream {
2117 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2118}
2119impl Default for MavDataStream {
2120 fn default() -> Self {
2121 Self::DEFAULT
2122 }
2123}
2124#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2125#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2126#[cfg_attr(feature = "serde", serde(tag = "type"))]
2127#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2128#[repr(u32)]
2129#[doc = "Enumeration of distance sensor types"]
2130pub enum MavDistanceSensor {
2131 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2132 MAV_DISTANCE_SENSOR_LASER = 0,
2133 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2134 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2135 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2136 MAV_DISTANCE_SENSOR_INFRARED = 2,
2137 #[doc = "Radar type, e.g. uLanding units"]
2138 MAV_DISTANCE_SENSOR_RADAR = 3,
2139 #[doc = "Broken or unknown type, e.g. analog units"]
2140 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2141}
2142impl MavDistanceSensor {
2143 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2144}
2145impl Default for MavDistanceSensor {
2146 fn default() -> Self {
2147 Self::DEFAULT
2148 }
2149}
2150#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2152#[cfg_attr(feature = "serde", serde(tag = "type"))]
2153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2154#[repr(u32)]
2155#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2156pub enum MavDoRepositionFlags {
2157 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2158 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2159}
2160impl MavDoRepositionFlags {
2161 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2162}
2163impl Default for MavDoRepositionFlags {
2164 fn default() -> Self {
2165 Self::DEFAULT
2166 }
2167}
2168#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2169#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2170#[cfg_attr(feature = "serde", serde(tag = "type"))]
2171#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2172#[repr(u32)]
2173#[doc = "Enumeration of estimator types"]
2174pub enum MavEstimatorType {
2175 #[doc = "Unknown type of the estimator."]
2176 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2177 #[doc = "This is a naive estimator without any real covariance feedback."]
2178 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2179 #[doc = "Computer vision based estimate. Might be up to scale."]
2180 MAV_ESTIMATOR_TYPE_VISION = 2,
2181 #[doc = "Visual-inertial estimate."]
2182 MAV_ESTIMATOR_TYPE_VIO = 3,
2183 #[doc = "Plain GPS estimate."]
2184 MAV_ESTIMATOR_TYPE_GPS = 4,
2185 #[doc = "Estimator integrating GPS and inertial sensing."]
2186 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2187 #[doc = "Estimate from external motion capturing system."]
2188 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2189 #[doc = "Estimator based on lidar sensor input."]
2190 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2191 #[doc = "Estimator on autopilot."]
2192 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2193}
2194impl MavEstimatorType {
2195 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2196}
2197impl Default for MavEstimatorType {
2198 fn default() -> Self {
2199 Self::DEFAULT
2200 }
2201}
2202#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2204#[cfg_attr(feature = "serde", serde(tag = "type"))]
2205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2206#[repr(u32)]
2207#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2208pub enum MavEventCurrentSequenceFlags {
2209 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2210 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2211}
2212impl MavEventCurrentSequenceFlags {
2213 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2214}
2215impl Default for MavEventCurrentSequenceFlags {
2216 fn default() -> Self {
2217 Self::DEFAULT
2218 }
2219}
2220#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2221#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2222#[cfg_attr(feature = "serde", serde(tag = "type"))]
2223#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2224#[repr(u32)]
2225#[doc = "Reason for an event error response."]
2226pub enum MavEventErrorReason {
2227 #[doc = "The requested event is not available (anymore)."]
2228 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2229}
2230impl MavEventErrorReason {
2231 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2232}
2233impl Default for MavEventErrorReason {
2234 fn default() -> Self {
2235 Self::DEFAULT
2236 }
2237}
2238#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2240#[cfg_attr(feature = "serde", serde(tag = "type"))]
2241#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2242#[repr(u32)]
2243#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2244pub enum MavFrame {
2245 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2246 MAV_FRAME_GLOBAL = 0,
2247 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2248 MAV_FRAME_LOCAL_NED = 1,
2249 #[doc = "NOT a coordinate frame, indicates a mission command."]
2250 MAV_FRAME_MISSION = 2,
2251 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2252 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2253 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2254 MAV_FRAME_LOCAL_ENU = 4,
2255 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2256 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2257 MAV_FRAME_GLOBAL_INT = 5,
2258 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2259 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2260 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2261 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2262 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2263 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2264 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2265 MAV_FRAME_BODY_NED = 8,
2266 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2267 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2268 MAV_FRAME_BODY_OFFSET_NED = 9,
2269 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2270 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2271 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2272 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2273 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2274 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2275 MAV_FRAME_BODY_FRD = 12,
2276 #[deprecated = " (Deprecated since 2019-04)"]
2277 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2278 MAV_FRAME_RESERVED_13 = 13,
2279 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2280 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2281 MAV_FRAME_RESERVED_14 = 14,
2282 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2283 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2284 MAV_FRAME_RESERVED_15 = 15,
2285 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2286 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2287 MAV_FRAME_RESERVED_16 = 16,
2288 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2289 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2290 MAV_FRAME_RESERVED_17 = 17,
2291 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2292 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2293 MAV_FRAME_RESERVED_18 = 18,
2294 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2295 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2296 MAV_FRAME_RESERVED_19 = 19,
2297 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2298 MAV_FRAME_LOCAL_FRD = 20,
2299 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2300 MAV_FRAME_LOCAL_FLU = 21,
2301}
2302impl MavFrame {
2303 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2304}
2305impl Default for MavFrame {
2306 fn default() -> Self {
2307 Self::DEFAULT
2308 }
2309}
2310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2312#[cfg_attr(feature = "serde", serde(tag = "type"))]
2313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2314#[repr(u32)]
2315#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2316pub enum MavFtpErr {
2317 #[doc = "None: No error"]
2318 MAV_FTP_ERR_NONE = 0,
2319 #[doc = "Fail: Unknown failure"]
2320 MAV_FTP_ERR_FAIL = 1,
2321 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2322 MAV_FTP_ERR_FAILERRNO = 2,
2323 #[doc = "InvalidDataSize: Payload size is invalid"]
2324 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2325 #[doc = "InvalidSession: Session is not currently open"]
2326 MAV_FTP_ERR_INVALIDSESSION = 4,
2327 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2328 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2329 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2330 MAV_FTP_ERR_EOF = 6,
2331 #[doc = "UnknownCommand: Unknown command / opcode"]
2332 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2333 #[doc = "FileExists: File/directory already exists"]
2334 MAV_FTP_ERR_FILEEXISTS = 8,
2335 #[doc = "FileProtected: File/directory is write protected"]
2336 MAV_FTP_ERR_FILEPROTECTED = 9,
2337 #[doc = "FileNotFound: File/directory not found"]
2338 MAV_FTP_ERR_FILENOTFOUND = 10,
2339}
2340impl MavFtpErr {
2341 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2342}
2343impl Default for MavFtpErr {
2344 fn default() -> Self {
2345 Self::DEFAULT
2346 }
2347}
2348#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2350#[cfg_attr(feature = "serde", serde(tag = "type"))]
2351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2352#[repr(u32)]
2353#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2354pub enum MavFtpOpcode {
2355 #[doc = "None. Ignored, always ACKed"]
2356 MAV_FTP_OPCODE_NONE = 0,
2357 #[doc = "TerminateSession: Terminates open Read session"]
2358 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2359 #[doc = "ResetSessions: Terminates all open read sessions"]
2360 MAV_FTP_OPCODE_RESETSESSION = 2,
2361 #[doc = "ListDirectory. List files and directories in path from offset"]
2362 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2363 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2364 MAV_FTP_OPCODE_OPENFILERO = 4,
2365 #[doc = "ReadFile: Reads size bytes from offset in session"]
2366 MAV_FTP_OPCODE_READFILE = 5,
2367 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2368 MAV_FTP_OPCODE_CREATEFILE = 6,
2369 #[doc = "WriteFile: Writes size bytes to offset in session"]
2370 MAV_FTP_OPCODE_WRITEFILE = 7,
2371 #[doc = "RemoveFile: Remove file at path"]
2372 MAV_FTP_OPCODE_REMOVEFILE = 8,
2373 #[doc = "CreateDirectory: Creates directory at path"]
2374 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2375 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2376 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2377 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2378 MAV_FTP_OPCODE_OPENFILEWO = 11,
2379 #[doc = "TruncateFile: Truncate file at path to offset length"]
2380 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2381 #[doc = "Rename: Rename path1 to path2"]
2382 MAV_FTP_OPCODE_RENAME = 13,
2383 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2384 MAV_FTP_OPCODE_CALCFILECRC = 14,
2385 #[doc = "BurstReadFile: Burst download session file"]
2386 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2387 #[doc = "ACK: ACK response"]
2388 MAV_FTP_OPCODE_ACK = 128,
2389 #[doc = "NAK: NAK response"]
2390 MAV_FTP_OPCODE_NAK = 129,
2391}
2392impl MavFtpOpcode {
2393 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2394}
2395impl Default for MavFtpOpcode {
2396 fn default() -> Self {
2397 Self::DEFAULT
2398 }
2399}
2400#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2401#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2402#[cfg_attr(feature = "serde", serde(tag = "type"))]
2403#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2404#[repr(u32)]
2405#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2406pub enum MavFuelType {
2407 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2408 MAV_FUEL_TYPE_UNKNOWN = 0,
2409 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2410 MAV_FUEL_TYPE_LIQUID = 1,
2411 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2412 MAV_FUEL_TYPE_GAS = 2,
2413}
2414impl MavFuelType {
2415 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2416}
2417impl Default for MavFuelType {
2418 fn default() -> Self {
2419 Self::DEFAULT
2420 }
2421}
2422bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2423impl MavGeneratorStatusFlag {
2424 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2425}
2426impl Default for MavGeneratorStatusFlag {
2427 fn default() -> Self {
2428 Self::DEFAULT
2429 }
2430}
2431#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2432#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2433#[cfg_attr(feature = "serde", serde(tag = "type"))]
2434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2435#[repr(u32)]
2436#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2437pub enum MavGoto {
2438 #[doc = "Hold at the current position."]
2439 MAV_GOTO_DO_HOLD = 0,
2440 #[doc = "Continue with the next item in mission execution."]
2441 MAV_GOTO_DO_CONTINUE = 1,
2442 #[doc = "Hold at the current position of the system"]
2443 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2444 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2445 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2446}
2447impl MavGoto {
2448 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2449}
2450impl Default for MavGoto {
2451 fn default() -> Self {
2452 Self::DEFAULT
2453 }
2454}
2455#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2457#[cfg_attr(feature = "serde", serde(tag = "type"))]
2458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2459#[repr(u32)]
2460#[doc = "Enumeration of landed detector states"]
2461pub enum MavLandedState {
2462 #[doc = "MAV landed state is unknown"]
2463 MAV_LANDED_STATE_UNDEFINED = 0,
2464 #[doc = "MAV is landed (on ground)"]
2465 MAV_LANDED_STATE_ON_GROUND = 1,
2466 #[doc = "MAV is in air"]
2467 MAV_LANDED_STATE_IN_AIR = 2,
2468 #[doc = "MAV currently taking off"]
2469 MAV_LANDED_STATE_TAKEOFF = 3,
2470 #[doc = "MAV currently landing"]
2471 MAV_LANDED_STATE_LANDING = 4,
2472}
2473impl MavLandedState {
2474 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2475}
2476impl Default for MavLandedState {
2477 fn default() -> Self {
2478 Self::DEFAULT
2479 }
2480}
2481#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2483#[cfg_attr(feature = "serde", serde(tag = "type"))]
2484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2485#[repr(u32)]
2486#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2487pub enum MavMissionResult {
2488 #[doc = "mission accepted OK"]
2489 MAV_MISSION_ACCEPTED = 0,
2490 #[doc = "Generic error / not accepting mission commands at all right now."]
2491 MAV_MISSION_ERROR = 1,
2492 #[doc = "Coordinate frame is not supported."]
2493 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2494 #[doc = "Command is not supported."]
2495 MAV_MISSION_UNSUPPORTED = 3,
2496 #[doc = "Mission items exceed storage space."]
2497 MAV_MISSION_NO_SPACE = 4,
2498 #[doc = "One of the parameters has an invalid value."]
2499 MAV_MISSION_INVALID = 5,
2500 #[doc = "param1 has an invalid value."]
2501 MAV_MISSION_INVALID_PARAM1 = 6,
2502 #[doc = "param2 has an invalid value."]
2503 MAV_MISSION_INVALID_PARAM2 = 7,
2504 #[doc = "param3 has an invalid value."]
2505 MAV_MISSION_INVALID_PARAM3 = 8,
2506 #[doc = "param4 has an invalid value."]
2507 MAV_MISSION_INVALID_PARAM4 = 9,
2508 #[doc = "x / param5 has an invalid value."]
2509 MAV_MISSION_INVALID_PARAM5_X = 10,
2510 #[doc = "y / param6 has an invalid value."]
2511 MAV_MISSION_INVALID_PARAM6_Y = 11,
2512 #[doc = "z / param7 has an invalid value."]
2513 MAV_MISSION_INVALID_PARAM7 = 12,
2514 #[doc = "Mission item received out of sequence"]
2515 MAV_MISSION_INVALID_SEQUENCE = 13,
2516 #[doc = "Not accepting any mission commands from this communication partner."]
2517 MAV_MISSION_DENIED = 14,
2518 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2519 MAV_MISSION_OPERATION_CANCELLED = 15,
2520}
2521impl MavMissionResult {
2522 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2523}
2524impl Default for MavMissionResult {
2525 fn default() -> Self {
2526 Self::DEFAULT
2527 }
2528}
2529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2531#[cfg_attr(feature = "serde", serde(tag = "type"))]
2532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2533#[repr(u32)]
2534#[doc = "Type of mission items being requested/sent in mission protocol."]
2535pub enum MavMissionType {
2536 #[doc = "Items are mission commands for main mission."]
2537 MAV_MISSION_TYPE_MISSION = 0,
2538 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2539 MAV_MISSION_TYPE_FENCE = 1,
2540 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2541 MAV_MISSION_TYPE_RALLY = 2,
2542 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2543 MAV_MISSION_TYPE_ALL = 255,
2544}
2545impl MavMissionType {
2546 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2547}
2548impl Default for MavMissionType {
2549 fn default() -> Self {
2550 Self::DEFAULT
2551 }
2552}
2553#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2554#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2555#[cfg_attr(feature = "serde", serde(tag = "type"))]
2556#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2557#[repr(u32)]
2558#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2559pub enum MavMode {
2560 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2561 MAV_MODE_PREFLIGHT = 0,
2562 #[doc = "System is allowed to be active, under assisted RC control."]
2563 MAV_MODE_STABILIZE_DISARMED = 80,
2564 #[doc = "System is allowed to be active, under assisted RC control."]
2565 MAV_MODE_STABILIZE_ARMED = 208,
2566 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2567 MAV_MODE_MANUAL_DISARMED = 64,
2568 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2569 MAV_MODE_MANUAL_ARMED = 192,
2570 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2571 MAV_MODE_GUIDED_DISARMED = 88,
2572 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2573 MAV_MODE_GUIDED_ARMED = 216,
2574 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2575 MAV_MODE_AUTO_DISARMED = 92,
2576 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2577 MAV_MODE_AUTO_ARMED = 220,
2578 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2579 MAV_MODE_TEST_DISARMED = 66,
2580 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2581 MAV_MODE_TEST_ARMED = 194,
2582}
2583impl MavMode {
2584 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2585}
2586impl Default for MavMode {
2587 fn default() -> Self {
2588 Self::DEFAULT
2589 }
2590}
2591bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2592impl MavModeFlag {
2593 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2594}
2595impl Default for MavModeFlag {
2596 fn default() -> Self {
2597 Self::DEFAULT
2598 }
2599}
2600#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2602#[cfg_attr(feature = "serde", serde(tag = "type"))]
2603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2604#[repr(u32)]
2605#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2606pub enum MavModeFlagDecodePosition {
2607 #[doc = "First bit: 10000000"]
2608 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2609 #[doc = "Second bit: 01000000"]
2610 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2611 #[doc = "Third bit: 00100000"]
2612 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2613 #[doc = "Fourth bit: 00010000"]
2614 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2615 #[doc = "Fifth bit: 00001000"]
2616 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2617 #[doc = "Sixth bit: 00000100"]
2618 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2619 #[doc = "Seventh bit: 00000010"]
2620 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2621 #[doc = "Eighth bit: 00000001"]
2622 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2623}
2624impl MavModeFlagDecodePosition {
2625 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2626}
2627impl Default for MavModeFlagDecodePosition {
2628 fn default() -> Self {
2629 Self::DEFAULT
2630 }
2631}
2632bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2633impl MavModeProperty {
2634 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2635}
2636impl Default for MavModeProperty {
2637 fn default() -> Self {
2638 Self::DEFAULT
2639 }
2640}
2641#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2642#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2643#[cfg_attr(feature = "serde", serde(tag = "type"))]
2644#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2645#[repr(u32)]
2646#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2647#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2648pub enum MavMountMode {
2649 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2650 MAV_MOUNT_MODE_RETRACT = 0,
2651 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2652 MAV_MOUNT_MODE_NEUTRAL = 1,
2653 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2654 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2655 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2656 MAV_MOUNT_MODE_RC_TARGETING = 3,
2657 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2658 MAV_MOUNT_MODE_GPS_POINT = 4,
2659 #[doc = "Gimbal tracks system with specified system ID"]
2660 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2661 #[doc = "Gimbal tracks home position"]
2662 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2663}
2664impl MavMountMode {
2665 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2666}
2667impl Default for MavMountMode {
2668 fn default() -> Self {
2669 Self::DEFAULT
2670 }
2671}
2672#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2674#[cfg_attr(feature = "serde", serde(tag = "type"))]
2675#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2676#[repr(u32)]
2677pub enum MavOdidArmStatus {
2678 #[doc = "Passing arming checks."]
2679 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2680 #[doc = "Generic arming failure, see error string for details."]
2681 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2682}
2683impl MavOdidArmStatus {
2684 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2685}
2686impl Default for MavOdidArmStatus {
2687 fn default() -> Self {
2688 Self::DEFAULT
2689 }
2690}
2691#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2693#[cfg_attr(feature = "serde", serde(tag = "type"))]
2694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2695#[repr(u32)]
2696pub enum MavOdidAuthType {
2697 #[doc = "No authentication type is specified."]
2698 MAV_ODID_AUTH_TYPE_NONE = 0,
2699 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2700 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2701 #[doc = "Signature for the Operator ID."]
2702 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2703 #[doc = "Signature for the entire message set."]
2704 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2705 #[doc = "Authentication is provided by Network Remote ID."]
2706 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2707 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2708 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2709}
2710impl MavOdidAuthType {
2711 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2712}
2713impl Default for MavOdidAuthType {
2714 fn default() -> Self {
2715 Self::DEFAULT
2716 }
2717}
2718#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2719#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2720#[cfg_attr(feature = "serde", serde(tag = "type"))]
2721#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2722#[repr(u32)]
2723pub enum MavOdidCategoryEu {
2724 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2725 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2726 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2727 MAV_ODID_CATEGORY_EU_OPEN = 1,
2728 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2729 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2730 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2731 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2732}
2733impl MavOdidCategoryEu {
2734 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2735}
2736impl Default for MavOdidCategoryEu {
2737 fn default() -> Self {
2738 Self::DEFAULT
2739 }
2740}
2741#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2742#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2743#[cfg_attr(feature = "serde", serde(tag = "type"))]
2744#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2745#[repr(u32)]
2746pub enum MavOdidClassEu {
2747 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2748 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2749 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2750 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2751 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2752 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2753 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2754 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2755 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2756 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2757 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2758 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2759 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2760 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2761 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2762 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2763}
2764impl MavOdidClassEu {
2765 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2766}
2767impl Default for MavOdidClassEu {
2768 fn default() -> Self {
2769 Self::DEFAULT
2770 }
2771}
2772#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2773#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2774#[cfg_attr(feature = "serde", serde(tag = "type"))]
2775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2776#[repr(u32)]
2777pub enum MavOdidClassificationType {
2778 #[doc = "The classification type for the UA is undeclared."]
2779 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2780 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2781 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2782}
2783impl MavOdidClassificationType {
2784 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2785}
2786impl Default for MavOdidClassificationType {
2787 fn default() -> Self {
2788 Self::DEFAULT
2789 }
2790}
2791#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2793#[cfg_attr(feature = "serde", serde(tag = "type"))]
2794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2795#[repr(u32)]
2796pub enum MavOdidDescType {
2797 #[doc = "Optional free-form text description of the purpose of the flight."]
2798 MAV_ODID_DESC_TYPE_TEXT = 0,
2799 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2800 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2801 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2802 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2803}
2804impl MavOdidDescType {
2805 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2806}
2807impl Default for MavOdidDescType {
2808 fn default() -> Self {
2809 Self::DEFAULT
2810 }
2811}
2812#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2814#[cfg_attr(feature = "serde", serde(tag = "type"))]
2815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2816#[repr(u32)]
2817pub enum MavOdidHeightRef {
2818 #[doc = "The height field is relative to the take-off location."]
2819 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2820 #[doc = "The height field is relative to ground."]
2821 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2822}
2823impl MavOdidHeightRef {
2824 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2825}
2826impl Default for MavOdidHeightRef {
2827 fn default() -> Self {
2828 Self::DEFAULT
2829 }
2830}
2831#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2832#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2833#[cfg_attr(feature = "serde", serde(tag = "type"))]
2834#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2835#[repr(u32)]
2836pub enum MavOdidHorAcc {
2837 #[doc = "The horizontal accuracy is unknown."]
2838 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2839 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2840 MAV_ODID_HOR_ACC_10NM = 1,
2841 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2842 MAV_ODID_HOR_ACC_4NM = 2,
2843 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2844 MAV_ODID_HOR_ACC_2NM = 3,
2845 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2846 MAV_ODID_HOR_ACC_1NM = 4,
2847 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2848 MAV_ODID_HOR_ACC_0_5NM = 5,
2849 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2850 MAV_ODID_HOR_ACC_0_3NM = 6,
2851 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2852 MAV_ODID_HOR_ACC_0_1NM = 7,
2853 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2854 MAV_ODID_HOR_ACC_0_05NM = 8,
2855 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2856 MAV_ODID_HOR_ACC_30_METER = 9,
2857 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2858 MAV_ODID_HOR_ACC_10_METER = 10,
2859 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2860 MAV_ODID_HOR_ACC_3_METER = 11,
2861 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2862 MAV_ODID_HOR_ACC_1_METER = 12,
2863}
2864impl MavOdidHorAcc {
2865 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2866}
2867impl Default for MavOdidHorAcc {
2868 fn default() -> Self {
2869 Self::DEFAULT
2870 }
2871}
2872#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2873#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2874#[cfg_attr(feature = "serde", serde(tag = "type"))]
2875#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2876#[repr(u32)]
2877pub enum MavOdidIdType {
2878 #[doc = "No type defined."]
2879 MAV_ODID_ID_TYPE_NONE = 0,
2880 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2881 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2882 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2883 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2884 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2885 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2886 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2887 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2888}
2889impl MavOdidIdType {
2890 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2891}
2892impl Default for MavOdidIdType {
2893 fn default() -> Self {
2894 Self::DEFAULT
2895 }
2896}
2897#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2899#[cfg_attr(feature = "serde", serde(tag = "type"))]
2900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2901#[repr(u32)]
2902pub enum MavOdidOperatorIdType {
2903 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2904 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2905}
2906impl MavOdidOperatorIdType {
2907 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2908}
2909impl Default for MavOdidOperatorIdType {
2910 fn default() -> Self {
2911 Self::DEFAULT
2912 }
2913}
2914#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2916#[cfg_attr(feature = "serde", serde(tag = "type"))]
2917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2918#[repr(u32)]
2919pub enum MavOdidOperatorLocationType {
2920 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2921 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2922 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2923 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2924 #[doc = "The location/altitude of the operator are fixed values."]
2925 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2926}
2927impl MavOdidOperatorLocationType {
2928 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2929}
2930impl Default for MavOdidOperatorLocationType {
2931 fn default() -> Self {
2932 Self::DEFAULT
2933 }
2934}
2935#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2937#[cfg_attr(feature = "serde", serde(tag = "type"))]
2938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2939#[repr(u32)]
2940pub enum MavOdidSpeedAcc {
2941 #[doc = "The speed accuracy is unknown."]
2942 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2943 #[doc = "The speed accuracy is smaller than 10 meters per second."]
2944 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
2945 #[doc = "The speed accuracy is smaller than 3 meters per second."]
2946 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
2947 #[doc = "The speed accuracy is smaller than 1 meters per second."]
2948 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
2949 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
2950 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
2951}
2952impl MavOdidSpeedAcc {
2953 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
2954}
2955impl Default for MavOdidSpeedAcc {
2956 fn default() -> Self {
2957 Self::DEFAULT
2958 }
2959}
2960#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2962#[cfg_attr(feature = "serde", serde(tag = "type"))]
2963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2964#[repr(u32)]
2965pub enum MavOdidStatus {
2966 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
2967 MAV_ODID_STATUS_UNDECLARED = 0,
2968 #[doc = "The UA is on the ground."]
2969 MAV_ODID_STATUS_GROUND = 1,
2970 #[doc = "The UA is in the air."]
2971 MAV_ODID_STATUS_AIRBORNE = 2,
2972 #[doc = "The UA is having an emergency."]
2973 MAV_ODID_STATUS_EMERGENCY = 3,
2974 #[doc = "The remote ID system is failing or unreliable in some way."]
2975 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
2976}
2977impl MavOdidStatus {
2978 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
2979}
2980impl Default for MavOdidStatus {
2981 fn default() -> Self {
2982 Self::DEFAULT
2983 }
2984}
2985#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2987#[cfg_attr(feature = "serde", serde(tag = "type"))]
2988#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2989#[repr(u32)]
2990pub enum MavOdidTimeAcc {
2991 #[doc = "The timestamp accuracy is unknown."]
2992 MAV_ODID_TIME_ACC_UNKNOWN = 0,
2993 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
2994 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
2995 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
2996 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
2997 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
2998 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
2999 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3000 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3001 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3002 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3003 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3004 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3005 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3006 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3007 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3008 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3009 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3010 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3011 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3012 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3013 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3014 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3015 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3016 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3017 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3018 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3019 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3020 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3021 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3022 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3023}
3024impl MavOdidTimeAcc {
3025 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3026}
3027impl Default for MavOdidTimeAcc {
3028 fn default() -> Self {
3029 Self::DEFAULT
3030 }
3031}
3032#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3034#[cfg_attr(feature = "serde", serde(tag = "type"))]
3035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3036#[repr(u32)]
3037pub enum MavOdidUaType {
3038 #[doc = "No UA (Unmanned Aircraft) type defined."]
3039 MAV_ODID_UA_TYPE_NONE = 0,
3040 #[doc = "Aeroplane/Airplane. Fixed wing."]
3041 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3042 #[doc = "Helicopter or multirotor."]
3043 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3044 #[doc = "Gyroplane."]
3045 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3046 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3047 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3048 #[doc = "Ornithopter."]
3049 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3050 #[doc = "Glider."]
3051 MAV_ODID_UA_TYPE_GLIDER = 6,
3052 #[doc = "Kite."]
3053 MAV_ODID_UA_TYPE_KITE = 7,
3054 #[doc = "Free Balloon."]
3055 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3056 #[doc = "Captive Balloon."]
3057 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3058 #[doc = "Airship. E.g. a blimp."]
3059 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3060 #[doc = "Free Fall/Parachute (unpowered)."]
3061 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3062 #[doc = "Rocket."]
3063 MAV_ODID_UA_TYPE_ROCKET = 12,
3064 #[doc = "Tethered powered aircraft."]
3065 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3066 #[doc = "Ground Obstacle."]
3067 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3068 #[doc = "Other type of aircraft not listed earlier."]
3069 MAV_ODID_UA_TYPE_OTHER = 15,
3070}
3071impl MavOdidUaType {
3072 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3073}
3074impl Default for MavOdidUaType {
3075 fn default() -> Self {
3076 Self::DEFAULT
3077 }
3078}
3079#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3080#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3081#[cfg_attr(feature = "serde", serde(tag = "type"))]
3082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3083#[repr(u32)]
3084pub enum MavOdidVerAcc {
3085 #[doc = "The vertical accuracy is unknown."]
3086 MAV_ODID_VER_ACC_UNKNOWN = 0,
3087 #[doc = "The vertical accuracy is smaller than 150 meter."]
3088 MAV_ODID_VER_ACC_150_METER = 1,
3089 #[doc = "The vertical accuracy is smaller than 45 meter."]
3090 MAV_ODID_VER_ACC_45_METER = 2,
3091 #[doc = "The vertical accuracy is smaller than 25 meter."]
3092 MAV_ODID_VER_ACC_25_METER = 3,
3093 #[doc = "The vertical accuracy is smaller than 10 meter."]
3094 MAV_ODID_VER_ACC_10_METER = 4,
3095 #[doc = "The vertical accuracy is smaller than 3 meter."]
3096 MAV_ODID_VER_ACC_3_METER = 5,
3097 #[doc = "The vertical accuracy is smaller than 1 meter."]
3098 MAV_ODID_VER_ACC_1_METER = 6,
3099}
3100impl MavOdidVerAcc {
3101 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3102}
3103impl Default for MavOdidVerAcc {
3104 fn default() -> Self {
3105 Self::DEFAULT
3106 }
3107}
3108#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3109#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3110#[cfg_attr(feature = "serde", serde(tag = "type"))]
3111#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3112#[repr(u32)]
3113#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3114pub enum MavParamExtType {
3115 #[doc = "8-bit unsigned integer"]
3116 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3117 #[doc = "8-bit signed integer"]
3118 MAV_PARAM_EXT_TYPE_INT8 = 2,
3119 #[doc = "16-bit unsigned integer"]
3120 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3121 #[doc = "16-bit signed integer"]
3122 MAV_PARAM_EXT_TYPE_INT16 = 4,
3123 #[doc = "32-bit unsigned integer"]
3124 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3125 #[doc = "32-bit signed integer"]
3126 MAV_PARAM_EXT_TYPE_INT32 = 6,
3127 #[doc = "64-bit unsigned integer"]
3128 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3129 #[doc = "64-bit signed integer"]
3130 MAV_PARAM_EXT_TYPE_INT64 = 8,
3131 #[doc = "32-bit floating-point"]
3132 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3133 #[doc = "64-bit floating-point"]
3134 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3135 #[doc = "Custom Type"]
3136 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3137}
3138impl MavParamExtType {
3139 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3140}
3141impl Default for MavParamExtType {
3142 fn default() -> Self {
3143 Self::DEFAULT
3144 }
3145}
3146#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3148#[cfg_attr(feature = "serde", serde(tag = "type"))]
3149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3150#[repr(u32)]
3151#[doc = "Specifies the datatype of a MAVLink parameter."]
3152pub enum MavParamType {
3153 #[doc = "8-bit unsigned integer"]
3154 MAV_PARAM_TYPE_UINT8 = 1,
3155 #[doc = "8-bit signed integer"]
3156 MAV_PARAM_TYPE_INT8 = 2,
3157 #[doc = "16-bit unsigned integer"]
3158 MAV_PARAM_TYPE_UINT16 = 3,
3159 #[doc = "16-bit signed integer"]
3160 MAV_PARAM_TYPE_INT16 = 4,
3161 #[doc = "32-bit unsigned integer"]
3162 MAV_PARAM_TYPE_UINT32 = 5,
3163 #[doc = "32-bit signed integer"]
3164 MAV_PARAM_TYPE_INT32 = 6,
3165 #[doc = "64-bit unsigned integer"]
3166 MAV_PARAM_TYPE_UINT64 = 7,
3167 #[doc = "64-bit signed integer"]
3168 MAV_PARAM_TYPE_INT64 = 8,
3169 #[doc = "32-bit floating-point"]
3170 MAV_PARAM_TYPE_REAL32 = 9,
3171 #[doc = "64-bit floating-point"]
3172 MAV_PARAM_TYPE_REAL64 = 10,
3173}
3174impl MavParamType {
3175 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3176}
3177impl Default for MavParamType {
3178 fn default() -> Self {
3179 Self::DEFAULT
3180 }
3181}
3182bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3183impl MavPowerStatus {
3184 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3185}
3186impl Default for MavPowerStatus {
3187 fn default() -> Self {
3188 Self::DEFAULT
3189 }
3190}
3191bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3192impl MavProtocolCapability {
3193 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3194}
3195impl Default for MavProtocolCapability {
3196 fn default() -> Self {
3197 Self::DEFAULT
3198 }
3199}
3200#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3201#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3202#[cfg_attr(feature = "serde", serde(tag = "type"))]
3203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3204#[repr(u32)]
3205#[doc = "Result from a MAVLink command (MAV_CMD)"]
3206pub enum MavResult {
3207 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3208 MAV_RESULT_ACCEPTED = 0,
3209 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3210 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3211 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3212 MAV_RESULT_DENIED = 2,
3213 #[doc = "Command is not supported (unknown)."]
3214 MAV_RESULT_UNSUPPORTED = 3,
3215 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3216 MAV_RESULT_FAILED = 4,
3217 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3218 MAV_RESULT_IN_PROGRESS = 5,
3219 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3220 MAV_RESULT_CANCELLED = 6,
3221 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3222 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3223 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3224 MAV_RESULT_COMMAND_INT_ONLY = 8,
3225 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3226 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3227}
3228impl MavResult {
3229 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3230}
3231impl Default for MavResult {
3232 fn default() -> Self {
3233 Self::DEFAULT
3234 }
3235}
3236#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3237#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3238#[cfg_attr(feature = "serde", serde(tag = "type"))]
3239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3240#[repr(u32)]
3241#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3242#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3243pub enum MavRoi {
3244 #[doc = "No region of interest."]
3245 MAV_ROI_NONE = 0,
3246 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3247 MAV_ROI_WPNEXT = 1,
3248 #[doc = "Point toward given waypoint."]
3249 MAV_ROI_WPINDEX = 2,
3250 #[doc = "Point toward fixed location."]
3251 MAV_ROI_LOCATION = 3,
3252 #[doc = "Point toward of given id."]
3253 MAV_ROI_TARGET = 4,
3254}
3255impl MavRoi {
3256 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3257}
3258impl Default for MavRoi {
3259 fn default() -> Self {
3260 Self::DEFAULT
3261 }
3262}
3263#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3265#[cfg_attr(feature = "serde", serde(tag = "type"))]
3266#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3267#[repr(u32)]
3268#[doc = "Enumeration of sensor orientation, according to its rotations"]
3269pub enum MavSensorOrientation {
3270 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3271 MAV_SENSOR_ROTATION_NONE = 0,
3272 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3273 MAV_SENSOR_ROTATION_YAW_45 = 1,
3274 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3275 MAV_SENSOR_ROTATION_YAW_90 = 2,
3276 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3277 MAV_SENSOR_ROTATION_YAW_135 = 3,
3278 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3279 MAV_SENSOR_ROTATION_YAW_180 = 4,
3280 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3281 MAV_SENSOR_ROTATION_YAW_225 = 5,
3282 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3283 MAV_SENSOR_ROTATION_YAW_270 = 6,
3284 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3285 MAV_SENSOR_ROTATION_YAW_315 = 7,
3286 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3287 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3288 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3289 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3290 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3291 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3292 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3293 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3294 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3295 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3296 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3297 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3298 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3299 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3300 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3301 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3302 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3303 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3304 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3305 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3306 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3307 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3308 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3309 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3310 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3311 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3312 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3313 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3314 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3315 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3316 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3317 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3318 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3319 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3320 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3321 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3322 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3323 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3324 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3325 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3326 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3327 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3328 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3329 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3330 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3331 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3332 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3333 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3334 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3335 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3336 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3337 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3338 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3339 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3340 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3341 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3342 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3343 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3344 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3345 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3346 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3347 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3348 #[doc = "Pitch: 315"]
3349 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3350 #[doc = "Roll: 90, Pitch: 315"]
3351 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3352 #[doc = "Custom orientation"]
3353 MAV_SENSOR_ROTATION_CUSTOM = 100,
3354}
3355impl MavSensorOrientation {
3356 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3357}
3358impl Default for MavSensorOrientation {
3359 fn default() -> Self {
3360 Self::DEFAULT
3361 }
3362}
3363#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3364#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3365#[cfg_attr(feature = "serde", serde(tag = "type"))]
3366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3367#[repr(u32)]
3368#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3369pub enum MavSeverity {
3370 #[doc = "System is unusable. This is a \"panic\" condition."]
3371 MAV_SEVERITY_EMERGENCY = 0,
3372 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3373 MAV_SEVERITY_ALERT = 1,
3374 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3375 MAV_SEVERITY_CRITICAL = 2,
3376 #[doc = "Indicates an error in secondary/redundant systems."]
3377 MAV_SEVERITY_ERROR = 3,
3378 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3379 MAV_SEVERITY_WARNING = 4,
3380 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3381 MAV_SEVERITY_NOTICE = 5,
3382 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3383 MAV_SEVERITY_INFO = 6,
3384 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3385 MAV_SEVERITY_DEBUG = 7,
3386}
3387impl MavSeverity {
3388 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3389}
3390impl Default for MavSeverity {
3391 fn default() -> Self {
3392 Self::DEFAULT
3393 }
3394}
3395#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3396#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3397#[cfg_attr(feature = "serde", serde(tag = "type"))]
3398#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3399#[repr(u32)]
3400#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3401pub enum MavStandardMode {
3402 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3403 MAV_STANDARD_MODE_NON_STANDARD = 0,
3404 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3405 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3406 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3407 MAV_STANDARD_MODE_ORBIT = 2,
3408 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3409 MAV_STANDARD_MODE_CRUISE = 3,
3410 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3411 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3412 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3413 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3414 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3415 MAV_STANDARD_MODE_MISSION = 6,
3416 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3417 MAV_STANDARD_MODE_LAND = 7,
3418 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3419 MAV_STANDARD_MODE_TAKEOFF = 8,
3420}
3421impl MavStandardMode {
3422 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3423}
3424impl Default for MavStandardMode {
3425 fn default() -> Self {
3426 Self::DEFAULT
3427 }
3428}
3429#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3431#[cfg_attr(feature = "serde", serde(tag = "type"))]
3432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3433#[repr(u32)]
3434pub enum MavState {
3435 #[doc = "Uninitialized system, state is unknown."]
3436 MAV_STATE_UNINIT = 0,
3437 #[doc = "System is booting up."]
3438 MAV_STATE_BOOT = 1,
3439 #[doc = "System is calibrating and not flight-ready."]
3440 MAV_STATE_CALIBRATING = 2,
3441 #[doc = "System is grounded and on standby. It can be launched any time."]
3442 MAV_STATE_STANDBY = 3,
3443 #[doc = "System is active and might be already airborne. Motors are engaged."]
3444 MAV_STATE_ACTIVE = 4,
3445 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3446 MAV_STATE_CRITICAL = 5,
3447 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3448 MAV_STATE_EMERGENCY = 6,
3449 #[doc = "System just initialized its power-down sequence, will shut down now."]
3450 MAV_STATE_POWEROFF = 7,
3451 #[doc = "System is terminating itself (failsafe or commanded)."]
3452 MAV_STATE_FLIGHT_TERMINATION = 8,
3453}
3454impl MavState {
3455 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3456}
3457impl Default for MavState {
3458 fn default() -> Self {
3459 Self::DEFAULT
3460 }
3461}
3462bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3463impl MavSysStatusSensor {
3464 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3465}
3466impl Default for MavSysStatusSensor {
3467 fn default() -> Self {
3468 Self::DEFAULT
3469 }
3470}
3471bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3472impl MavSysStatusSensorExtended {
3473 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3474}
3475impl Default for MavSysStatusSensorExtended {
3476 fn default() -> Self {
3477 Self::DEFAULT
3478 }
3479}
3480#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3482#[cfg_attr(feature = "serde", serde(tag = "type"))]
3483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3484#[repr(u32)]
3485pub enum MavTunnelPayloadType {
3486 #[doc = "Encoding of payload unknown."]
3487 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3488 #[doc = "Registered for STorM32 gimbal controller."]
3489 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3490 #[doc = "Registered for STorM32 gimbal controller."]
3491 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3492 #[doc = "Registered for STorM32 gimbal controller."]
3493 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3494 #[doc = "Registered for STorM32 gimbal controller."]
3495 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3496 #[doc = "Registered for STorM32 gimbal controller."]
3497 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3498 #[doc = "Registered for STorM32 gimbal controller."]
3499 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3500 #[doc = "Registered for STorM32 gimbal controller."]
3501 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3502 #[doc = "Registered for STorM32 gimbal controller."]
3503 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3504 #[doc = "Registered for STorM32 gimbal controller."]
3505 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3506 #[doc = "Registered for STorM32 gimbal controller."]
3507 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3508 #[doc = "Registered for ModalAI remote OSD protocol."]
3509 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3510 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3511 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3512 #[doc = "Registered for ModalAI vendor use."]
3513 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3514}
3515impl MavTunnelPayloadType {
3516 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3517}
3518impl Default for MavTunnelPayloadType {
3519 fn default() -> Self {
3520 Self::DEFAULT
3521 }
3522}
3523#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3525#[cfg_attr(feature = "serde", serde(tag = "type"))]
3526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3527#[repr(u32)]
3528#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3529pub enum MavType {
3530 #[doc = "Generic micro air vehicle"]
3531 MAV_TYPE_GENERIC = 0,
3532 #[doc = "Fixed wing aircraft."]
3533 MAV_TYPE_FIXED_WING = 1,
3534 #[doc = "Quadrotor"]
3535 MAV_TYPE_QUADROTOR = 2,
3536 #[doc = "Coaxial helicopter"]
3537 MAV_TYPE_COAXIAL = 3,
3538 #[doc = "Normal helicopter with tail rotor."]
3539 MAV_TYPE_HELICOPTER = 4,
3540 #[doc = "Ground installation"]
3541 MAV_TYPE_ANTENNA_TRACKER = 5,
3542 #[doc = "Operator control unit / ground control station"]
3543 MAV_TYPE_GCS = 6,
3544 #[doc = "Airship, controlled"]
3545 MAV_TYPE_AIRSHIP = 7,
3546 #[doc = "Free balloon, uncontrolled"]
3547 MAV_TYPE_FREE_BALLOON = 8,
3548 #[doc = "Rocket"]
3549 MAV_TYPE_ROCKET = 9,
3550 #[doc = "Ground rover"]
3551 MAV_TYPE_GROUND_ROVER = 10,
3552 #[doc = "Surface vessel, boat, ship"]
3553 MAV_TYPE_SURFACE_BOAT = 11,
3554 #[doc = "Submarine"]
3555 MAV_TYPE_SUBMARINE = 12,
3556 #[doc = "Hexarotor"]
3557 MAV_TYPE_HEXAROTOR = 13,
3558 #[doc = "Octorotor"]
3559 MAV_TYPE_OCTOROTOR = 14,
3560 #[doc = "Tricopter"]
3561 MAV_TYPE_TRICOPTER = 15,
3562 #[doc = "Flapping wing"]
3563 MAV_TYPE_FLAPPING_WING = 16,
3564 #[doc = "Kite"]
3565 MAV_TYPE_KITE = 17,
3566 #[doc = "Onboard companion controller"]
3567 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3568 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3569 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3570 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3571 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3572 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3573 MAV_TYPE_VTOL_TILTROTOR = 21,
3574 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3575 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3576 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3577 MAV_TYPE_VTOL_TAILSITTER = 23,
3578 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3579 MAV_TYPE_VTOL_TILTWING = 24,
3580 #[doc = "VTOL reserved 5"]
3581 MAV_TYPE_VTOL_RESERVED5 = 25,
3582 #[doc = "Gimbal"]
3583 MAV_TYPE_GIMBAL = 26,
3584 #[doc = "ADSB system"]
3585 MAV_TYPE_ADSB = 27,
3586 #[doc = "Steerable, nonrigid airfoil"]
3587 MAV_TYPE_PARAFOIL = 28,
3588 #[doc = "Dodecarotor"]
3589 MAV_TYPE_DODECAROTOR = 29,
3590 #[doc = "Camera"]
3591 MAV_TYPE_CAMERA = 30,
3592 #[doc = "Charging station"]
3593 MAV_TYPE_CHARGING_STATION = 31,
3594 #[doc = "FLARM collision avoidance system"]
3595 MAV_TYPE_FLARM = 32,
3596 #[doc = "Servo"]
3597 MAV_TYPE_SERVO = 33,
3598 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3599 MAV_TYPE_ODID = 34,
3600 #[doc = "Decarotor"]
3601 MAV_TYPE_DECAROTOR = 35,
3602 #[doc = "Battery"]
3603 MAV_TYPE_BATTERY = 36,
3604 #[doc = "Parachute"]
3605 MAV_TYPE_PARACHUTE = 37,
3606 #[doc = "Log"]
3607 MAV_TYPE_LOG = 38,
3608 #[doc = "OSD"]
3609 MAV_TYPE_OSD = 39,
3610 #[doc = "IMU"]
3611 MAV_TYPE_IMU = 40,
3612 #[doc = "GPS"]
3613 MAV_TYPE_GPS = 41,
3614 #[doc = "Winch"]
3615 MAV_TYPE_WINCH = 42,
3616 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3617 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3618 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3619 MAV_TYPE_ILLUMINATOR = 44,
3620 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3621 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3622}
3623impl MavType {
3624 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3625}
3626impl Default for MavType {
3627 fn default() -> Self {
3628 Self::DEFAULT
3629 }
3630}
3631#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3633#[cfg_attr(feature = "serde", serde(tag = "type"))]
3634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3635#[repr(u32)]
3636#[doc = "Enumeration of VTOL states"]
3637pub enum MavVtolState {
3638 #[doc = "MAV is not configured as VTOL"]
3639 MAV_VTOL_STATE_UNDEFINED = 0,
3640 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3641 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3642 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3643 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3644 #[doc = "VTOL is in multicopter state"]
3645 MAV_VTOL_STATE_MC = 3,
3646 #[doc = "VTOL is in fixed-wing state"]
3647 MAV_VTOL_STATE_FW = 4,
3648}
3649impl MavVtolState {
3650 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3651}
3652impl Default for MavVtolState {
3653 fn default() -> Self {
3654 Self::DEFAULT
3655 }
3656}
3657bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3658impl MavWinchStatusFlag {
3659 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3660}
3661impl Default for MavWinchStatusFlag {
3662 fn default() -> Self {
3663 Self::DEFAULT
3664 }
3665}
3666#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3667#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3668#[cfg_attr(feature = "serde", serde(tag = "type"))]
3669#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3670#[repr(u32)]
3671pub enum MavlinkDataStreamType {
3672 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3673 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3674 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3675 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3676 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3677 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3678}
3679impl MavlinkDataStreamType {
3680 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3681}
3682impl Default for MavlinkDataStreamType {
3683 fn default() -> Self {
3684 Self::DEFAULT
3685 }
3686}
3687#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3689#[cfg_attr(feature = "serde", serde(tag = "type"))]
3690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3691#[repr(u32)]
3692#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3693pub enum MissionState {
3694 #[doc = "The mission status reporting is not supported."]
3695 MISSION_STATE_UNKNOWN = 0,
3696 #[doc = "No mission on the vehicle."]
3697 MISSION_STATE_NO_MISSION = 1,
3698 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3699 MISSION_STATE_NOT_STARTED = 2,
3700 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3701 MISSION_STATE_ACTIVE = 3,
3702 #[doc = "Mission is paused when in auto mode."]
3703 MISSION_STATE_PAUSED = 4,
3704 #[doc = "Mission has executed all mission items."]
3705 MISSION_STATE_COMPLETE = 5,
3706}
3707impl MissionState {
3708 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3709}
3710impl Default for MissionState {
3711 fn default() -> Self {
3712 Self::DEFAULT
3713 }
3714}
3715#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3716#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3717#[cfg_attr(feature = "serde", serde(tag = "type"))]
3718#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3719#[repr(u32)]
3720#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3721pub enum MotorTestOrder {
3722 #[doc = "Default autopilot motor test method."]
3723 MOTOR_TEST_ORDER_DEFAULT = 0,
3724 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3725 MOTOR_TEST_ORDER_SEQUENCE = 1,
3726 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3727 MOTOR_TEST_ORDER_BOARD = 2,
3728}
3729impl MotorTestOrder {
3730 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3731}
3732impl Default for MotorTestOrder {
3733 fn default() -> Self {
3734 Self::DEFAULT
3735 }
3736}
3737#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3738#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3739#[cfg_attr(feature = "serde", serde(tag = "type"))]
3740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3741#[repr(u32)]
3742#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3743pub enum MotorTestThrottleType {
3744 #[doc = "Throttle as a percentage (0 ~ 100)"]
3745 MOTOR_TEST_THROTTLE_PERCENT = 0,
3746 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3747 MOTOR_TEST_THROTTLE_PWM = 1,
3748 #[doc = "Throttle pass-through from pilot's transmitter."]
3749 MOTOR_TEST_THROTTLE_PILOT = 2,
3750 #[doc = "Per-motor compass calibration test."]
3751 MOTOR_TEST_COMPASS_CAL = 3,
3752}
3753impl MotorTestThrottleType {
3754 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3755}
3756impl Default for MotorTestThrottleType {
3757 fn default() -> Self {
3758 Self::DEFAULT
3759 }
3760}
3761#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3763#[cfg_attr(feature = "serde", serde(tag = "type"))]
3764#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3765#[repr(u32)]
3766pub enum NavVtolLandOptions {
3767 #[doc = "Default autopilot landing behaviour."]
3768 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3769 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3770 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3771 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3772 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3773}
3774impl NavVtolLandOptions {
3775 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3776}
3777impl Default for NavVtolLandOptions {
3778 fn default() -> Self {
3779 Self::DEFAULT
3780 }
3781}
3782#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3784#[cfg_attr(feature = "serde", serde(tag = "type"))]
3785#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3786#[repr(u32)]
3787#[doc = "Yaw behaviour during orbit flight."]
3788pub enum OrbitYawBehaviour {
3789 #[doc = "Vehicle front points to the center (default)."]
3790 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3791 #[doc = "Vehicle front holds heading when message received."]
3792 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3793 #[doc = "Yaw uncontrolled."]
3794 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3795 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3796 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3797 #[doc = "Yaw controlled by RC input."]
3798 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3799 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3800 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3801}
3802impl OrbitYawBehaviour {
3803 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3804}
3805impl Default for OrbitYawBehaviour {
3806 fn default() -> Self {
3807 Self::DEFAULT
3808 }
3809}
3810#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3812#[cfg_attr(feature = "serde", serde(tag = "type"))]
3813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3814#[repr(u32)]
3815#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3816pub enum ParachuteAction {
3817 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3818 PARACHUTE_DISABLE = 0,
3819 #[doc = "Enable auto-release of parachute."]
3820 PARACHUTE_ENABLE = 1,
3821 #[doc = "Release parachute and kill motors."]
3822 PARACHUTE_RELEASE = 2,
3823}
3824impl ParachuteAction {
3825 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3826}
3827impl Default for ParachuteAction {
3828 fn default() -> Self {
3829 Self::DEFAULT
3830 }
3831}
3832#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3833#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3834#[cfg_attr(feature = "serde", serde(tag = "type"))]
3835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3836#[repr(u32)]
3837#[doc = "Result from PARAM_EXT_SET message."]
3838pub enum ParamAck {
3839 #[doc = "Parameter value ACCEPTED and SET"]
3840 PARAM_ACK_ACCEPTED = 0,
3841 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3842 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3843 #[doc = "Parameter failed to set"]
3844 PARAM_ACK_FAILED = 2,
3845 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3846 PARAM_ACK_IN_PROGRESS = 3,
3847}
3848impl ParamAck {
3849 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3850}
3851impl Default for ParamAck {
3852 fn default() -> Self {
3853 Self::DEFAULT
3854 }
3855}
3856bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3857impl PositionTargetTypemask {
3858 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3859}
3860impl Default for PositionTargetTypemask {
3861 fn default() -> Self {
3862 Self::DEFAULT
3863 }
3864}
3865#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3867#[cfg_attr(feature = "serde", serde(tag = "type"))]
3868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3869#[repr(u32)]
3870#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3871pub enum PrecisionLandMode {
3872 #[doc = "Normal (non-precision) landing."]
3873 PRECISION_LAND_MODE_DISABLED = 0,
3874 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3875 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3876 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3877 PRECISION_LAND_MODE_REQUIRED = 2,
3878}
3879impl PrecisionLandMode {
3880 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3881}
3882impl Default for PrecisionLandMode {
3883 fn default() -> Self {
3884 Self::DEFAULT
3885 }
3886}
3887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3889#[cfg_attr(feature = "serde", serde(tag = "type"))]
3890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3891#[repr(u32)]
3892#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3893pub enum PreflightStorageMissionAction {
3894 #[doc = "Read current mission data from persistent storage"]
3895 MISSION_READ_PERSISTENT = 0,
3896 #[doc = "Write current mission data to persistent storage"]
3897 MISSION_WRITE_PERSISTENT = 1,
3898 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3899 MISSION_RESET_DEFAULT = 2,
3900}
3901impl PreflightStorageMissionAction {
3902 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3903}
3904impl Default for PreflightStorageMissionAction {
3905 fn default() -> Self {
3906 Self::DEFAULT
3907 }
3908}
3909#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3911#[cfg_attr(feature = "serde", serde(tag = "type"))]
3912#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3913#[repr(u32)]
3914#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3915pub enum PreflightStorageParameterAction {
3916 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3917 PARAM_READ_PERSISTENT = 0,
3918 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3919 PARAM_WRITE_PERSISTENT = 1,
3920 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3921 PARAM_RESET_CONFIG_DEFAULT = 2,
3922 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3923 PARAM_RESET_SENSOR_DEFAULT = 3,
3924 #[doc = "Reset all parameters, including operation counters, to default values"]
3925 PARAM_RESET_ALL_DEFAULT = 4,
3926}
3927impl PreflightStorageParameterAction {
3928 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3929}
3930impl Default for PreflightStorageParameterAction {
3931 fn default() -> Self {
3932 Self::DEFAULT
3933 }
3934}
3935#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3937#[cfg_attr(feature = "serde", serde(tag = "type"))]
3938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3939#[repr(u32)]
3940#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3941pub enum RcSubType {
3942 #[doc = "Spektrum DSM2"]
3943 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
3944 #[doc = "Spektrum DSMX"]
3945 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
3946 #[doc = "Spektrum DSMX8"]
3947 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
3948}
3949impl RcSubType {
3950 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
3951}
3952impl Default for RcSubType {
3953 fn default() -> Self {
3954 Self::DEFAULT
3955 }
3956}
3957#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3958#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3959#[cfg_attr(feature = "serde", serde(tag = "type"))]
3960#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3961#[repr(u32)]
3962#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
3963pub enum RcType {
3964 #[doc = "Spektrum"]
3965 RC_TYPE_SPEKTRUM = 0,
3966 #[doc = "CRSF"]
3967 RC_TYPE_CRSF = 1,
3968}
3969impl RcType {
3970 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
3971}
3972impl Default for RcType {
3973 fn default() -> Self {
3974 Self::DEFAULT
3975 }
3976}
3977#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3978#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3979#[cfg_attr(feature = "serde", serde(tag = "type"))]
3980#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3981#[repr(u32)]
3982#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
3983pub enum RebootShutdownConditions {
3984 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
3985 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
3986 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
3987 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
3988}
3989impl RebootShutdownConditions {
3990 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
3991}
3992impl Default for RebootShutdownConditions {
3993 fn default() -> Self {
3994 Self::DEFAULT
3995 }
3996}
3997#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3998#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3999#[cfg_attr(feature = "serde", serde(tag = "type"))]
4000#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4001#[repr(u32)]
4002#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4003pub enum RtkBaselineCoordinateSystem {
4004 #[doc = "Earth-centered, Earth-fixed"]
4005 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4006 #[doc = "RTK basestation centered, north, east, down"]
4007 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4008}
4009impl RtkBaselineCoordinateSystem {
4010 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4011}
4012impl Default for RtkBaselineCoordinateSystem {
4013 fn default() -> Self {
4014 Self::DEFAULT
4015 }
4016}
4017#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4018#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4019#[cfg_attr(feature = "serde", serde(tag = "type"))]
4020#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4021#[repr(u32)]
4022#[doc = "Possible safety switch states."]
4023pub enum SafetySwitchState {
4024 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4025 SAFETY_SWITCH_STATE_SAFE = 0,
4026 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4027 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4028}
4029impl SafetySwitchState {
4030 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4031}
4032impl Default for SafetySwitchState {
4033 fn default() -> Self {
4034 Self::DEFAULT
4035 }
4036}
4037#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4038#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4039#[cfg_attr(feature = "serde", serde(tag = "type"))]
4040#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4041#[repr(u32)]
4042#[doc = "SERIAL_CONTROL device types"]
4043pub enum SerialControlDev {
4044 #[doc = "First telemetry port"]
4045 SERIAL_CONTROL_DEV_TELEM1 = 0,
4046 #[doc = "Second telemetry port"]
4047 SERIAL_CONTROL_DEV_TELEM2 = 1,
4048 #[doc = "First GPS port"]
4049 SERIAL_CONTROL_DEV_GPS1 = 2,
4050 #[doc = "Second GPS port"]
4051 SERIAL_CONTROL_DEV_GPS2 = 3,
4052 #[doc = "system shell"]
4053 SERIAL_CONTROL_DEV_SHELL = 10,
4054 #[doc = "SERIAL0"]
4055 SERIAL_CONTROL_SERIAL0 = 100,
4056 #[doc = "SERIAL1"]
4057 SERIAL_CONTROL_SERIAL1 = 101,
4058 #[doc = "SERIAL2"]
4059 SERIAL_CONTROL_SERIAL2 = 102,
4060 #[doc = "SERIAL3"]
4061 SERIAL_CONTROL_SERIAL3 = 103,
4062 #[doc = "SERIAL4"]
4063 SERIAL_CONTROL_SERIAL4 = 104,
4064 #[doc = "SERIAL5"]
4065 SERIAL_CONTROL_SERIAL5 = 105,
4066 #[doc = "SERIAL6"]
4067 SERIAL_CONTROL_SERIAL6 = 106,
4068 #[doc = "SERIAL7"]
4069 SERIAL_CONTROL_SERIAL7 = 107,
4070 #[doc = "SERIAL8"]
4071 SERIAL_CONTROL_SERIAL8 = 108,
4072 #[doc = "SERIAL9"]
4073 SERIAL_CONTROL_SERIAL9 = 109,
4074}
4075impl SerialControlDev {
4076 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4077}
4078impl Default for SerialControlDev {
4079 fn default() -> Self {
4080 Self::DEFAULT
4081 }
4082}
4083bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4084impl SerialControlFlag {
4085 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4086}
4087impl Default for SerialControlFlag {
4088 fn default() -> Self {
4089 Self::DEFAULT
4090 }
4091}
4092#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4093#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4094#[cfg_attr(feature = "serde", serde(tag = "type"))]
4095#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4096#[repr(u32)]
4097#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4098pub enum SetFocusType {
4099 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4100 FOCUS_TYPE_STEP = 0,
4101 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4102 FOCUS_TYPE_CONTINUOUS = 1,
4103 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4104 FOCUS_TYPE_RANGE = 2,
4105 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4106 FOCUS_TYPE_METERS = 3,
4107 #[doc = "Focus automatically."]
4108 FOCUS_TYPE_AUTO = 4,
4109 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4110 FOCUS_TYPE_AUTO_SINGLE = 5,
4111 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4112 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4113}
4114impl SetFocusType {
4115 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4116}
4117impl Default for SetFocusType {
4118 fn default() -> Self {
4119 Self::DEFAULT
4120 }
4121}
4122#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4124#[cfg_attr(feature = "serde", serde(tag = "type"))]
4125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4126#[repr(u32)]
4127#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4128pub enum SpeedType {
4129 #[doc = "Airspeed"]
4130 SPEED_TYPE_AIRSPEED = 0,
4131 #[doc = "Groundspeed"]
4132 SPEED_TYPE_GROUNDSPEED = 1,
4133 #[doc = "Climb speed"]
4134 SPEED_TYPE_CLIMB_SPEED = 2,
4135 #[doc = "Descent speed"]
4136 SPEED_TYPE_DESCENT_SPEED = 3,
4137}
4138impl SpeedType {
4139 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4140}
4141impl Default for SpeedType {
4142 fn default() -> Self {
4143 Self::DEFAULT
4144 }
4145}
4146#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4148#[cfg_attr(feature = "serde", serde(tag = "type"))]
4149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4150#[repr(u32)]
4151#[doc = "Flags to indicate the status of camera storage."]
4152pub enum StorageStatus {
4153 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4154 STORAGE_STATUS_EMPTY = 0,
4155 #[doc = "Storage present but unformatted."]
4156 STORAGE_STATUS_UNFORMATTED = 1,
4157 #[doc = "Storage present and ready."]
4158 STORAGE_STATUS_READY = 2,
4159 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4160 STORAGE_STATUS_NOT_SUPPORTED = 3,
4161}
4162impl StorageStatus {
4163 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4164}
4165impl Default for StorageStatus {
4166 fn default() -> Self {
4167 Self::DEFAULT
4168 }
4169}
4170#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4172#[cfg_attr(feature = "serde", serde(tag = "type"))]
4173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4174#[repr(u32)]
4175#[doc = "Flags to indicate the type of storage."]
4176pub enum StorageType {
4177 #[doc = "Storage type is not known."]
4178 STORAGE_TYPE_UNKNOWN = 0,
4179 #[doc = "Storage type is USB device."]
4180 STORAGE_TYPE_USB_STICK = 1,
4181 #[doc = "Storage type is SD card."]
4182 STORAGE_TYPE_SD = 2,
4183 #[doc = "Storage type is microSD card."]
4184 STORAGE_TYPE_MICROSD = 3,
4185 #[doc = "Storage type is CFast."]
4186 STORAGE_TYPE_CF = 4,
4187 #[doc = "Storage type is CFexpress."]
4188 STORAGE_TYPE_CFE = 5,
4189 #[doc = "Storage type is XQD."]
4190 STORAGE_TYPE_XQD = 6,
4191 #[doc = "Storage type is HD mass storage type."]
4192 STORAGE_TYPE_HD = 7,
4193 #[doc = "Storage type is other, not listed type."]
4194 STORAGE_TYPE_OTHER = 254,
4195}
4196impl StorageType {
4197 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4198}
4199impl Default for StorageType {
4200 fn default() -> Self {
4201 Self::DEFAULT
4202 }
4203}
4204bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4205impl StorageUsageFlag {
4206 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4207}
4208impl Default for StorageUsageFlag {
4209 fn default() -> Self {
4210 Self::DEFAULT
4211 }
4212}
4213#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4215#[cfg_attr(feature = "serde", serde(tag = "type"))]
4216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4217#[repr(u32)]
4218#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4219pub enum TuneFormat {
4220 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4221 TUNE_FORMAT_QBASIC1_1 = 1,
4222 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4223 TUNE_FORMAT_MML_MODERN = 2,
4224}
4225impl TuneFormat {
4226 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4227}
4228impl Default for TuneFormat {
4229 fn default() -> Self {
4230 Self::DEFAULT
4231 }
4232}
4233#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4234#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4235#[cfg_attr(feature = "serde", serde(tag = "type"))]
4236#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4237#[repr(u32)]
4238#[doc = "Generalized UAVCAN node health"]
4239pub enum UavcanNodeHealth {
4240 #[doc = "The node is functioning properly."]
4241 UAVCAN_NODE_HEALTH_OK = 0,
4242 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4243 UAVCAN_NODE_HEALTH_WARNING = 1,
4244 #[doc = "The node has encountered a major failure."]
4245 UAVCAN_NODE_HEALTH_ERROR = 2,
4246 #[doc = "The node has suffered a fatal malfunction."]
4247 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4248}
4249impl UavcanNodeHealth {
4250 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4251}
4252impl Default for UavcanNodeHealth {
4253 fn default() -> Self {
4254 Self::DEFAULT
4255 }
4256}
4257#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4259#[cfg_attr(feature = "serde", serde(tag = "type"))]
4260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4261#[repr(u32)]
4262#[doc = "Generalized UAVCAN node mode"]
4263pub enum UavcanNodeMode {
4264 #[doc = "The node is performing its primary functions."]
4265 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4266 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4267 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4268 #[doc = "The node is under maintenance."]
4269 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4270 #[doc = "The node is in the process of updating its software."]
4271 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4272 #[doc = "The node is no longer available online."]
4273 UAVCAN_NODE_MODE_OFFLINE = 7,
4274}
4275impl UavcanNodeMode {
4276 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4277}
4278impl Default for UavcanNodeMode {
4279 fn default() -> Self {
4280 Self::DEFAULT
4281 }
4282}
4283bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4284impl UtmDataAvailFlags {
4285 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4286}
4287impl Default for UtmDataAvailFlags {
4288 fn default() -> Self {
4289 Self::DEFAULT
4290 }
4291}
4292#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4293#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4294#[cfg_attr(feature = "serde", serde(tag = "type"))]
4295#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4296#[repr(u32)]
4297#[doc = "Airborne status of UAS."]
4298pub enum UtmFlightState {
4299 #[doc = "The flight state can't be determined."]
4300 UTM_FLIGHT_STATE_UNKNOWN = 1,
4301 #[doc = "UAS on ground."]
4302 UTM_FLIGHT_STATE_GROUND = 2,
4303 #[doc = "UAS airborne."]
4304 UTM_FLIGHT_STATE_AIRBORNE = 3,
4305 #[doc = "UAS is in an emergency flight state."]
4306 UTM_FLIGHT_STATE_EMERGENCY = 16,
4307 #[doc = "UAS has no active controls."]
4308 UTM_FLIGHT_STATE_NOCTRL = 32,
4309}
4310impl UtmFlightState {
4311 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4312}
4313impl Default for UtmFlightState {
4314 fn default() -> Self {
4315 Self::DEFAULT
4316 }
4317}
4318#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4320#[cfg_attr(feature = "serde", serde(tag = "type"))]
4321#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4322#[repr(u32)]
4323#[doc = "Video stream encodings"]
4324pub enum VideoStreamEncoding {
4325 #[doc = "Stream encoding is unknown"]
4326 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4327 #[doc = "Stream encoding is H.264"]
4328 VIDEO_STREAM_ENCODING_H264 = 1,
4329 #[doc = "Stream encoding is H.265"]
4330 VIDEO_STREAM_ENCODING_H265 = 2,
4331}
4332impl VideoStreamEncoding {
4333 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4334}
4335impl Default for VideoStreamEncoding {
4336 fn default() -> Self {
4337 Self::DEFAULT
4338 }
4339}
4340bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4341impl VideoStreamStatusFlags {
4342 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4343}
4344impl Default for VideoStreamStatusFlags {
4345 fn default() -> Self {
4346 Self::DEFAULT
4347 }
4348}
4349#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4351#[cfg_attr(feature = "serde", serde(tag = "type"))]
4352#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4353#[repr(u32)]
4354#[doc = "Video stream types"]
4355pub enum VideoStreamType {
4356 #[doc = "Stream is RTSP"]
4357 VIDEO_STREAM_TYPE_RTSP = 0,
4358 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4359 VIDEO_STREAM_TYPE_RTPUDP = 1,
4360 #[doc = "Stream is MPEG on TCP"]
4361 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4362 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4363 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4364}
4365impl VideoStreamType {
4366 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4367}
4368impl Default for VideoStreamType {
4369 fn default() -> Self {
4370 Self::DEFAULT
4371 }
4372}
4373#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4375#[cfg_attr(feature = "serde", serde(tag = "type"))]
4376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4377#[repr(u32)]
4378#[doc = "Direction of VTOL transition"]
4379pub enum VtolTransitionHeading {
4380 #[doc = "Respect the heading configuration of the vehicle."]
4381 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4382 #[doc = "Use the heading pointing towards the next waypoint."]
4383 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4384 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4385 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4386 #[doc = "Use the specified heading in parameter 4."]
4387 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4388 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4389 VTOL_TRANSITION_HEADING_ANY = 4,
4390}
4391impl VtolTransitionHeading {
4392 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4393}
4394impl Default for VtolTransitionHeading {
4395 fn default() -> Self {
4396 Self::DEFAULT
4397 }
4398}
4399#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4401#[cfg_attr(feature = "serde", serde(tag = "type"))]
4402#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4403#[repr(u32)]
4404#[doc = "WiFi Mode."]
4405pub enum WifiConfigApMode {
4406 #[doc = "WiFi mode is undefined."]
4407 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4408 #[doc = "WiFi configured as an access point."]
4409 WIFI_CONFIG_AP_MODE_AP = 1,
4410 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4411 WIFI_CONFIG_AP_MODE_STATION = 2,
4412 #[doc = "WiFi disabled."]
4413 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4414}
4415impl WifiConfigApMode {
4416 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4417}
4418impl Default for WifiConfigApMode {
4419 fn default() -> Self {
4420 Self::DEFAULT
4421 }
4422}
4423#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4424#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4425#[cfg_attr(feature = "serde", serde(tag = "type"))]
4426#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4427#[repr(u32)]
4428#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4429pub enum WifiConfigApResponse {
4430 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4431 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4432 #[doc = "Changes accepted."]
4433 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4434 #[doc = "Changes rejected."]
4435 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4436 #[doc = "Invalid Mode."]
4437 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4438 #[doc = "Invalid SSID."]
4439 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4440 #[doc = "Invalid Password."]
4441 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4442}
4443impl WifiConfigApResponse {
4444 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4445}
4446impl Default for WifiConfigApResponse {
4447 fn default() -> Self {
4448 Self::DEFAULT
4449 }
4450}
4451#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4453#[cfg_attr(feature = "serde", serde(tag = "type"))]
4454#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4455#[repr(u32)]
4456#[doc = "Winch actions."]
4457pub enum WinchActions {
4458 #[doc = "Allow motor to freewheel."]
4459 WINCH_RELAXED = 0,
4460 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4461 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4462 #[doc = "Wind or unwind line at specified rate."]
4463 WINCH_RATE_CONTROL = 2,
4464 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4465 WINCH_LOCK = 3,
4466 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4467 WINCH_DELIVER = 4,
4468 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4469 WINCH_HOLD = 5,
4470 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4471 WINCH_RETRACT = 6,
4472 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4473 WINCH_LOAD_LINE = 7,
4474 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4475 WINCH_ABANDON_LINE = 8,
4476 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4477 WINCH_LOAD_PAYLOAD = 9,
4478}
4479impl WinchActions {
4480 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4481}
4482impl Default for WinchActions {
4483 fn default() -> Self {
4484 Self::DEFAULT
4485 }
4486}
4487#[doc = "id: 140"]
4488#[doc = "Set the vehicle attitude and body angular rates."]
4489#[derive(Debug, Clone, PartialEq)]
4490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4492pub struct ACTUATOR_CONTROL_TARGET_DATA {
4493 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4494 pub time_usec: u64,
4495 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4496 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4497 pub controls: [f32; 8],
4498 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4499 pub group_mlx: u8,
4500}
4501impl ACTUATOR_CONTROL_TARGET_DATA {
4502 pub const ENCODED_LEN: usize = 41usize;
4503 pub const DEFAULT: Self = Self {
4504 time_usec: 0_u64,
4505 controls: [0.0_f32; 8usize],
4506 group_mlx: 0_u8,
4507 };
4508 #[cfg(feature = "arbitrary")]
4509 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4510 use arbitrary::{Arbitrary, Unstructured};
4511 let mut buf = [0u8; 1024];
4512 rng.fill_bytes(&mut buf);
4513 let mut unstructured = Unstructured::new(&buf);
4514 Self::arbitrary(&mut unstructured).unwrap_or_default()
4515 }
4516}
4517impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4518 fn default() -> Self {
4519 Self::DEFAULT.clone()
4520 }
4521}
4522impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4523 type Message = MavMessage;
4524 const ID: u32 = 140u32;
4525 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4526 const EXTRA_CRC: u8 = 181u8;
4527 const ENCODED_LEN: usize = 41usize;
4528 fn deser(
4529 _version: MavlinkVersion,
4530 __input: &[u8],
4531 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4532 let avail_len = __input.len();
4533 let mut payload_buf = [0; Self::ENCODED_LEN];
4534 let mut buf = if avail_len < Self::ENCODED_LEN {
4535 payload_buf[0..avail_len].copy_from_slice(__input);
4536 Bytes::new(&payload_buf)
4537 } else {
4538 Bytes::new(__input)
4539 };
4540 let mut __struct = Self::default();
4541 __struct.time_usec = buf.get_u64_le();
4542 for v in &mut __struct.controls {
4543 let val = buf.get_f32_le();
4544 *v = val;
4545 }
4546 __struct.group_mlx = buf.get_u8();
4547 Ok(__struct)
4548 }
4549 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4550 let mut __tmp = BytesMut::new(bytes);
4551 #[allow(clippy::absurd_extreme_comparisons)]
4552 #[allow(unused_comparisons)]
4553 if __tmp.remaining() < Self::ENCODED_LEN {
4554 panic!(
4555 "buffer is too small (need {} bytes, but got {})",
4556 Self::ENCODED_LEN,
4557 __tmp.remaining(),
4558 )
4559 }
4560 __tmp.put_u64_le(self.time_usec);
4561 for val in &self.controls {
4562 __tmp.put_f32_le(*val);
4563 }
4564 __tmp.put_u8(self.group_mlx);
4565 if matches!(version, MavlinkVersion::V2) {
4566 let len = __tmp.len();
4567 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4568 } else {
4569 __tmp.len()
4570 }
4571 }
4572}
4573#[doc = "id: 375"]
4574#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4575#[derive(Debug, Clone, PartialEq)]
4576#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4577#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4578pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4579 #[doc = "Timestamp (since system boot)."]
4580 pub time_usec: u64,
4581 #[doc = "Active outputs"]
4582 pub active: u32,
4583 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4584 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4585 pub actuator: [f32; 32],
4586}
4587impl ACTUATOR_OUTPUT_STATUS_DATA {
4588 pub const ENCODED_LEN: usize = 140usize;
4589 pub const DEFAULT: Self = Self {
4590 time_usec: 0_u64,
4591 active: 0_u32,
4592 actuator: [0.0_f32; 32usize],
4593 };
4594 #[cfg(feature = "arbitrary")]
4595 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4596 use arbitrary::{Arbitrary, Unstructured};
4597 let mut buf = [0u8; 1024];
4598 rng.fill_bytes(&mut buf);
4599 let mut unstructured = Unstructured::new(&buf);
4600 Self::arbitrary(&mut unstructured).unwrap_or_default()
4601 }
4602}
4603impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4604 fn default() -> Self {
4605 Self::DEFAULT.clone()
4606 }
4607}
4608impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4609 type Message = MavMessage;
4610 const ID: u32 = 375u32;
4611 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4612 const EXTRA_CRC: u8 = 251u8;
4613 const ENCODED_LEN: usize = 140usize;
4614 fn deser(
4615 _version: MavlinkVersion,
4616 __input: &[u8],
4617 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4618 let avail_len = __input.len();
4619 let mut payload_buf = [0; Self::ENCODED_LEN];
4620 let mut buf = if avail_len < Self::ENCODED_LEN {
4621 payload_buf[0..avail_len].copy_from_slice(__input);
4622 Bytes::new(&payload_buf)
4623 } else {
4624 Bytes::new(__input)
4625 };
4626 let mut __struct = Self::default();
4627 __struct.time_usec = buf.get_u64_le();
4628 __struct.active = buf.get_u32_le();
4629 for v in &mut __struct.actuator {
4630 let val = buf.get_f32_le();
4631 *v = val;
4632 }
4633 Ok(__struct)
4634 }
4635 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4636 let mut __tmp = BytesMut::new(bytes);
4637 #[allow(clippy::absurd_extreme_comparisons)]
4638 #[allow(unused_comparisons)]
4639 if __tmp.remaining() < Self::ENCODED_LEN {
4640 panic!(
4641 "buffer is too small (need {} bytes, but got {})",
4642 Self::ENCODED_LEN,
4643 __tmp.remaining(),
4644 )
4645 }
4646 __tmp.put_u64_le(self.time_usec);
4647 __tmp.put_u32_le(self.active);
4648 for val in &self.actuator {
4649 __tmp.put_f32_le(*val);
4650 }
4651 if matches!(version, MavlinkVersion::V2) {
4652 let len = __tmp.len();
4653 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4654 } else {
4655 __tmp.len()
4656 }
4657 }
4658}
4659#[doc = "id: 246"]
4660#[doc = "The location and information of an ADSB vehicle."]
4661#[derive(Debug, Clone, PartialEq)]
4662#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4663#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4664pub struct ADSB_VEHICLE_DATA {
4665 #[doc = "ICAO address"]
4666 pub ICAO_address: u32,
4667 #[doc = "Latitude"]
4668 pub lat: i32,
4669 #[doc = "Longitude"]
4670 pub lon: i32,
4671 #[doc = "Altitude(ASL)"]
4672 pub altitude: i32,
4673 #[doc = "Course over ground"]
4674 pub heading: u16,
4675 #[doc = "The horizontal velocity"]
4676 pub hor_velocity: u16,
4677 #[doc = "The vertical velocity. Positive is up"]
4678 pub ver_velocity: i16,
4679 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4680 pub flags: AdsbFlags,
4681 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4682 pub squawk: u16,
4683 #[doc = "ADSB altitude type."]
4684 pub altitude_type: AdsbAltitudeType,
4685 #[doc = "The callsign, 8+null"]
4686 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4687 pub callsign: [u8; 9],
4688 #[doc = "ADSB emitter type."]
4689 pub emitter_type: AdsbEmitterType,
4690 #[doc = "Time since last communication in seconds"]
4691 pub tslc: u8,
4692}
4693impl ADSB_VEHICLE_DATA {
4694 pub const ENCODED_LEN: usize = 38usize;
4695 pub const DEFAULT: Self = Self {
4696 ICAO_address: 0_u32,
4697 lat: 0_i32,
4698 lon: 0_i32,
4699 altitude: 0_i32,
4700 heading: 0_u16,
4701 hor_velocity: 0_u16,
4702 ver_velocity: 0_i16,
4703 flags: AdsbFlags::DEFAULT,
4704 squawk: 0_u16,
4705 altitude_type: AdsbAltitudeType::DEFAULT,
4706 callsign: [0_u8; 9usize],
4707 emitter_type: AdsbEmitterType::DEFAULT,
4708 tslc: 0_u8,
4709 };
4710 #[cfg(feature = "arbitrary")]
4711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4712 use arbitrary::{Arbitrary, Unstructured};
4713 let mut buf = [0u8; 1024];
4714 rng.fill_bytes(&mut buf);
4715 let mut unstructured = Unstructured::new(&buf);
4716 Self::arbitrary(&mut unstructured).unwrap_or_default()
4717 }
4718}
4719impl Default for ADSB_VEHICLE_DATA {
4720 fn default() -> Self {
4721 Self::DEFAULT.clone()
4722 }
4723}
4724impl MessageData for ADSB_VEHICLE_DATA {
4725 type Message = MavMessage;
4726 const ID: u32 = 246u32;
4727 const NAME: &'static str = "ADSB_VEHICLE";
4728 const EXTRA_CRC: u8 = 184u8;
4729 const ENCODED_LEN: usize = 38usize;
4730 fn deser(
4731 _version: MavlinkVersion,
4732 __input: &[u8],
4733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4734 let avail_len = __input.len();
4735 let mut payload_buf = [0; Self::ENCODED_LEN];
4736 let mut buf = if avail_len < Self::ENCODED_LEN {
4737 payload_buf[0..avail_len].copy_from_slice(__input);
4738 Bytes::new(&payload_buf)
4739 } else {
4740 Bytes::new(__input)
4741 };
4742 let mut __struct = Self::default();
4743 __struct.ICAO_address = buf.get_u32_le();
4744 __struct.lat = buf.get_i32_le();
4745 __struct.lon = buf.get_i32_le();
4746 __struct.altitude = buf.get_i32_le();
4747 __struct.heading = buf.get_u16_le();
4748 __struct.hor_velocity = buf.get_u16_le();
4749 __struct.ver_velocity = buf.get_i16_le();
4750 let tmp = buf.get_u16_le();
4751 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4752 ::mavlink_core::error::ParserError::InvalidFlag {
4753 flag_type: "AdsbFlags",
4754 value: tmp as u32,
4755 },
4756 )?;
4757 __struct.squawk = buf.get_u16_le();
4758 let tmp = buf.get_u8();
4759 __struct.altitude_type =
4760 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4761 enum_type: "AdsbAltitudeType",
4762 value: tmp as u32,
4763 })?;
4764 for v in &mut __struct.callsign {
4765 let val = buf.get_u8();
4766 *v = val;
4767 }
4768 let tmp = buf.get_u8();
4769 __struct.emitter_type =
4770 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4771 enum_type: "AdsbEmitterType",
4772 value: tmp as u32,
4773 })?;
4774 __struct.tslc = buf.get_u8();
4775 Ok(__struct)
4776 }
4777 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4778 let mut __tmp = BytesMut::new(bytes);
4779 #[allow(clippy::absurd_extreme_comparisons)]
4780 #[allow(unused_comparisons)]
4781 if __tmp.remaining() < Self::ENCODED_LEN {
4782 panic!(
4783 "buffer is too small (need {} bytes, but got {})",
4784 Self::ENCODED_LEN,
4785 __tmp.remaining(),
4786 )
4787 }
4788 __tmp.put_u32_le(self.ICAO_address);
4789 __tmp.put_i32_le(self.lat);
4790 __tmp.put_i32_le(self.lon);
4791 __tmp.put_i32_le(self.altitude);
4792 __tmp.put_u16_le(self.heading);
4793 __tmp.put_u16_le(self.hor_velocity);
4794 __tmp.put_i16_le(self.ver_velocity);
4795 __tmp.put_u16_le(self.flags.bits());
4796 __tmp.put_u16_le(self.squawk);
4797 __tmp.put_u8(self.altitude_type as u8);
4798 for val in &self.callsign {
4799 __tmp.put_u8(*val);
4800 }
4801 __tmp.put_u8(self.emitter_type as u8);
4802 __tmp.put_u8(self.tslc);
4803 if matches!(version, MavlinkVersion::V2) {
4804 let len = __tmp.len();
4805 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4806 } else {
4807 __tmp.len()
4808 }
4809 }
4810}
4811#[doc = "id: 301"]
4812#[doc = "The location and information of an AIS vessel."]
4813#[derive(Debug, Clone, PartialEq)]
4814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4816pub struct AIS_VESSEL_DATA {
4817 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4818 pub MMSI: u32,
4819 #[doc = "Latitude"]
4820 pub lat: i32,
4821 #[doc = "Longitude"]
4822 pub lon: i32,
4823 #[doc = "Course over ground"]
4824 pub COG: u16,
4825 #[doc = "True heading"]
4826 pub heading: u16,
4827 #[doc = "Speed over ground"]
4828 pub velocity: u16,
4829 #[doc = "Distance from lat/lon location to bow"]
4830 pub dimension_bow: u16,
4831 #[doc = "Distance from lat/lon location to stern"]
4832 pub dimension_stern: u16,
4833 #[doc = "Time since last communication in seconds"]
4834 pub tslc: u16,
4835 #[doc = "Bitmask to indicate various statuses including valid data fields"]
4836 pub flags: AisFlags,
4837 #[doc = "Turn rate"]
4838 pub turn_rate: i8,
4839 #[doc = "Navigational status"]
4840 pub navigational_status: AisNavStatus,
4841 #[doc = "Type of vessels"]
4842 pub mavtype: AisType,
4843 #[doc = "Distance from lat/lon location to port side"]
4844 pub dimension_port: u8,
4845 #[doc = "Distance from lat/lon location to starboard side"]
4846 pub dimension_starboard: u8,
4847 #[doc = "The vessel callsign"]
4848 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4849 pub callsign: [u8; 7],
4850 #[doc = "The vessel name"]
4851 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4852 pub name: [u8; 20],
4853}
4854impl AIS_VESSEL_DATA {
4855 pub const ENCODED_LEN: usize = 58usize;
4856 pub const DEFAULT: Self = Self {
4857 MMSI: 0_u32,
4858 lat: 0_i32,
4859 lon: 0_i32,
4860 COG: 0_u16,
4861 heading: 0_u16,
4862 velocity: 0_u16,
4863 dimension_bow: 0_u16,
4864 dimension_stern: 0_u16,
4865 tslc: 0_u16,
4866 flags: AisFlags::DEFAULT,
4867 turn_rate: 0_i8,
4868 navigational_status: AisNavStatus::DEFAULT,
4869 mavtype: AisType::DEFAULT,
4870 dimension_port: 0_u8,
4871 dimension_starboard: 0_u8,
4872 callsign: [0_u8; 7usize],
4873 name: [0_u8; 20usize],
4874 };
4875 #[cfg(feature = "arbitrary")]
4876 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4877 use arbitrary::{Arbitrary, Unstructured};
4878 let mut buf = [0u8; 1024];
4879 rng.fill_bytes(&mut buf);
4880 let mut unstructured = Unstructured::new(&buf);
4881 Self::arbitrary(&mut unstructured).unwrap_or_default()
4882 }
4883}
4884impl Default for AIS_VESSEL_DATA {
4885 fn default() -> Self {
4886 Self::DEFAULT.clone()
4887 }
4888}
4889impl MessageData for AIS_VESSEL_DATA {
4890 type Message = MavMessage;
4891 const ID: u32 = 301u32;
4892 const NAME: &'static str = "AIS_VESSEL";
4893 const EXTRA_CRC: u8 = 243u8;
4894 const ENCODED_LEN: usize = 58usize;
4895 fn deser(
4896 _version: MavlinkVersion,
4897 __input: &[u8],
4898 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4899 let avail_len = __input.len();
4900 let mut payload_buf = [0; Self::ENCODED_LEN];
4901 let mut buf = if avail_len < Self::ENCODED_LEN {
4902 payload_buf[0..avail_len].copy_from_slice(__input);
4903 Bytes::new(&payload_buf)
4904 } else {
4905 Bytes::new(__input)
4906 };
4907 let mut __struct = Self::default();
4908 __struct.MMSI = buf.get_u32_le();
4909 __struct.lat = buf.get_i32_le();
4910 __struct.lon = buf.get_i32_le();
4911 __struct.COG = buf.get_u16_le();
4912 __struct.heading = buf.get_u16_le();
4913 __struct.velocity = buf.get_u16_le();
4914 __struct.dimension_bow = buf.get_u16_le();
4915 __struct.dimension_stern = buf.get_u16_le();
4916 __struct.tslc = buf.get_u16_le();
4917 let tmp = buf.get_u16_le();
4918 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
4919 ::mavlink_core::error::ParserError::InvalidFlag {
4920 flag_type: "AisFlags",
4921 value: tmp as u32,
4922 },
4923 )?;
4924 __struct.turn_rate = buf.get_i8();
4925 let tmp = buf.get_u8();
4926 __struct.navigational_status =
4927 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4928 enum_type: "AisNavStatus",
4929 value: tmp as u32,
4930 })?;
4931 let tmp = buf.get_u8();
4932 __struct.mavtype =
4933 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4934 enum_type: "AisType",
4935 value: tmp as u32,
4936 })?;
4937 __struct.dimension_port = buf.get_u8();
4938 __struct.dimension_starboard = buf.get_u8();
4939 for v in &mut __struct.callsign {
4940 let val = buf.get_u8();
4941 *v = val;
4942 }
4943 for v in &mut __struct.name {
4944 let val = buf.get_u8();
4945 *v = val;
4946 }
4947 Ok(__struct)
4948 }
4949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4950 let mut __tmp = BytesMut::new(bytes);
4951 #[allow(clippy::absurd_extreme_comparisons)]
4952 #[allow(unused_comparisons)]
4953 if __tmp.remaining() < Self::ENCODED_LEN {
4954 panic!(
4955 "buffer is too small (need {} bytes, but got {})",
4956 Self::ENCODED_LEN,
4957 __tmp.remaining(),
4958 )
4959 }
4960 __tmp.put_u32_le(self.MMSI);
4961 __tmp.put_i32_le(self.lat);
4962 __tmp.put_i32_le(self.lon);
4963 __tmp.put_u16_le(self.COG);
4964 __tmp.put_u16_le(self.heading);
4965 __tmp.put_u16_le(self.velocity);
4966 __tmp.put_u16_le(self.dimension_bow);
4967 __tmp.put_u16_le(self.dimension_stern);
4968 __tmp.put_u16_le(self.tslc);
4969 __tmp.put_u16_le(self.flags.bits());
4970 __tmp.put_i8(self.turn_rate);
4971 __tmp.put_u8(self.navigational_status as u8);
4972 __tmp.put_u8(self.mavtype as u8);
4973 __tmp.put_u8(self.dimension_port);
4974 __tmp.put_u8(self.dimension_starboard);
4975 for val in &self.callsign {
4976 __tmp.put_u8(*val);
4977 }
4978 for val in &self.name {
4979 __tmp.put_u8(*val);
4980 }
4981 if matches!(version, MavlinkVersion::V2) {
4982 let len = __tmp.len();
4983 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4984 } else {
4985 __tmp.len()
4986 }
4987 }
4988}
4989#[doc = "id: 141"]
4990#[doc = "The current system altitude."]
4991#[derive(Debug, Clone, PartialEq)]
4992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4994pub struct ALTITUDE_DATA {
4995 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4996 pub time_usec: u64,
4997 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
4998 pub altitude_monotonic: f32,
4999 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5000 pub altitude_amsl: f32,
5001 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5002 pub altitude_local: f32,
5003 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5004 pub altitude_relative: f32,
5005 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5006 pub altitude_terrain: f32,
5007 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5008 pub bottom_clearance: f32,
5009}
5010impl ALTITUDE_DATA {
5011 pub const ENCODED_LEN: usize = 32usize;
5012 pub const DEFAULT: Self = Self {
5013 time_usec: 0_u64,
5014 altitude_monotonic: 0.0_f32,
5015 altitude_amsl: 0.0_f32,
5016 altitude_local: 0.0_f32,
5017 altitude_relative: 0.0_f32,
5018 altitude_terrain: 0.0_f32,
5019 bottom_clearance: 0.0_f32,
5020 };
5021 #[cfg(feature = "arbitrary")]
5022 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5023 use arbitrary::{Arbitrary, Unstructured};
5024 let mut buf = [0u8; 1024];
5025 rng.fill_bytes(&mut buf);
5026 let mut unstructured = Unstructured::new(&buf);
5027 Self::arbitrary(&mut unstructured).unwrap_or_default()
5028 }
5029}
5030impl Default for ALTITUDE_DATA {
5031 fn default() -> Self {
5032 Self::DEFAULT.clone()
5033 }
5034}
5035impl MessageData for ALTITUDE_DATA {
5036 type Message = MavMessage;
5037 const ID: u32 = 141u32;
5038 const NAME: &'static str = "ALTITUDE";
5039 const EXTRA_CRC: u8 = 47u8;
5040 const ENCODED_LEN: usize = 32usize;
5041 fn deser(
5042 _version: MavlinkVersion,
5043 __input: &[u8],
5044 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5045 let avail_len = __input.len();
5046 let mut payload_buf = [0; Self::ENCODED_LEN];
5047 let mut buf = if avail_len < Self::ENCODED_LEN {
5048 payload_buf[0..avail_len].copy_from_slice(__input);
5049 Bytes::new(&payload_buf)
5050 } else {
5051 Bytes::new(__input)
5052 };
5053 let mut __struct = Self::default();
5054 __struct.time_usec = buf.get_u64_le();
5055 __struct.altitude_monotonic = buf.get_f32_le();
5056 __struct.altitude_amsl = buf.get_f32_le();
5057 __struct.altitude_local = buf.get_f32_le();
5058 __struct.altitude_relative = buf.get_f32_le();
5059 __struct.altitude_terrain = buf.get_f32_le();
5060 __struct.bottom_clearance = buf.get_f32_le();
5061 Ok(__struct)
5062 }
5063 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5064 let mut __tmp = BytesMut::new(bytes);
5065 #[allow(clippy::absurd_extreme_comparisons)]
5066 #[allow(unused_comparisons)]
5067 if __tmp.remaining() < Self::ENCODED_LEN {
5068 panic!(
5069 "buffer is too small (need {} bytes, but got {})",
5070 Self::ENCODED_LEN,
5071 __tmp.remaining(),
5072 )
5073 }
5074 __tmp.put_u64_le(self.time_usec);
5075 __tmp.put_f32_le(self.altitude_monotonic);
5076 __tmp.put_f32_le(self.altitude_amsl);
5077 __tmp.put_f32_le(self.altitude_local);
5078 __tmp.put_f32_le(self.altitude_relative);
5079 __tmp.put_f32_le(self.altitude_terrain);
5080 __tmp.put_f32_le(self.bottom_clearance);
5081 if matches!(version, MavlinkVersion::V2) {
5082 let len = __tmp.len();
5083 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5084 } else {
5085 __tmp.len()
5086 }
5087 }
5088}
5089#[doc = "id: 8004"]
5090#[doc = "ASL-fixed-wing controller data."]
5091#[derive(Debug, Clone, PartialEq)]
5092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5094pub struct ASLCTRL_DATA_DATA {
5095 #[doc = "Timestamp"]
5096 pub timestamp: u64,
5097 #[doc = "See sourcecode for a description of these values..."]
5098 pub h: f32,
5099 pub hRef: f32,
5100 pub hRef_t: f32,
5101 #[doc = "Pitch angle"]
5102 pub PitchAngle: f32,
5103 #[doc = "Pitch angle reference"]
5104 pub PitchAngleRef: f32,
5105 pub q: f32,
5106 pub qRef: f32,
5107 pub uElev: f32,
5108 pub uThrot: f32,
5109 pub uThrot2: f32,
5110 pub nZ: f32,
5111 #[doc = "Airspeed reference"]
5112 pub AirspeedRef: f32,
5113 #[doc = "Yaw angle"]
5114 pub YawAngle: f32,
5115 #[doc = "Yaw angle reference"]
5116 pub YawAngleRef: f32,
5117 #[doc = "Roll angle"]
5118 pub RollAngle: f32,
5119 #[doc = "Roll angle reference"]
5120 pub RollAngleRef: f32,
5121 pub p: f32,
5122 pub pRef: f32,
5123 pub r: f32,
5124 pub rRef: f32,
5125 pub uAil: f32,
5126 pub uRud: f32,
5127 #[doc = "ASLCTRL control-mode (manual, stabilized, auto, etc...)"]
5128 pub aslctrl_mode: u8,
5129 pub SpoilersEngaged: u8,
5130}
5131impl ASLCTRL_DATA_DATA {
5132 pub const ENCODED_LEN: usize = 98usize;
5133 pub const DEFAULT: Self = Self {
5134 timestamp: 0_u64,
5135 h: 0.0_f32,
5136 hRef: 0.0_f32,
5137 hRef_t: 0.0_f32,
5138 PitchAngle: 0.0_f32,
5139 PitchAngleRef: 0.0_f32,
5140 q: 0.0_f32,
5141 qRef: 0.0_f32,
5142 uElev: 0.0_f32,
5143 uThrot: 0.0_f32,
5144 uThrot2: 0.0_f32,
5145 nZ: 0.0_f32,
5146 AirspeedRef: 0.0_f32,
5147 YawAngle: 0.0_f32,
5148 YawAngleRef: 0.0_f32,
5149 RollAngle: 0.0_f32,
5150 RollAngleRef: 0.0_f32,
5151 p: 0.0_f32,
5152 pRef: 0.0_f32,
5153 r: 0.0_f32,
5154 rRef: 0.0_f32,
5155 uAil: 0.0_f32,
5156 uRud: 0.0_f32,
5157 aslctrl_mode: 0_u8,
5158 SpoilersEngaged: 0_u8,
5159 };
5160 #[cfg(feature = "arbitrary")]
5161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5162 use arbitrary::{Arbitrary, Unstructured};
5163 let mut buf = [0u8; 1024];
5164 rng.fill_bytes(&mut buf);
5165 let mut unstructured = Unstructured::new(&buf);
5166 Self::arbitrary(&mut unstructured).unwrap_or_default()
5167 }
5168}
5169impl Default for ASLCTRL_DATA_DATA {
5170 fn default() -> Self {
5171 Self::DEFAULT.clone()
5172 }
5173}
5174impl MessageData for ASLCTRL_DATA_DATA {
5175 type Message = MavMessage;
5176 const ID: u32 = 8004u32;
5177 const NAME: &'static str = "ASLCTRL_DATA";
5178 const EXTRA_CRC: u8 = 172u8;
5179 const ENCODED_LEN: usize = 98usize;
5180 fn deser(
5181 _version: MavlinkVersion,
5182 __input: &[u8],
5183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5184 let avail_len = __input.len();
5185 let mut payload_buf = [0; Self::ENCODED_LEN];
5186 let mut buf = if avail_len < Self::ENCODED_LEN {
5187 payload_buf[0..avail_len].copy_from_slice(__input);
5188 Bytes::new(&payload_buf)
5189 } else {
5190 Bytes::new(__input)
5191 };
5192 let mut __struct = Self::default();
5193 __struct.timestamp = buf.get_u64_le();
5194 __struct.h = buf.get_f32_le();
5195 __struct.hRef = buf.get_f32_le();
5196 __struct.hRef_t = buf.get_f32_le();
5197 __struct.PitchAngle = buf.get_f32_le();
5198 __struct.PitchAngleRef = buf.get_f32_le();
5199 __struct.q = buf.get_f32_le();
5200 __struct.qRef = buf.get_f32_le();
5201 __struct.uElev = buf.get_f32_le();
5202 __struct.uThrot = buf.get_f32_le();
5203 __struct.uThrot2 = buf.get_f32_le();
5204 __struct.nZ = buf.get_f32_le();
5205 __struct.AirspeedRef = buf.get_f32_le();
5206 __struct.YawAngle = buf.get_f32_le();
5207 __struct.YawAngleRef = buf.get_f32_le();
5208 __struct.RollAngle = buf.get_f32_le();
5209 __struct.RollAngleRef = buf.get_f32_le();
5210 __struct.p = buf.get_f32_le();
5211 __struct.pRef = buf.get_f32_le();
5212 __struct.r = buf.get_f32_le();
5213 __struct.rRef = buf.get_f32_le();
5214 __struct.uAil = buf.get_f32_le();
5215 __struct.uRud = buf.get_f32_le();
5216 __struct.aslctrl_mode = buf.get_u8();
5217 __struct.SpoilersEngaged = buf.get_u8();
5218 Ok(__struct)
5219 }
5220 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5221 let mut __tmp = BytesMut::new(bytes);
5222 #[allow(clippy::absurd_extreme_comparisons)]
5223 #[allow(unused_comparisons)]
5224 if __tmp.remaining() < Self::ENCODED_LEN {
5225 panic!(
5226 "buffer is too small (need {} bytes, but got {})",
5227 Self::ENCODED_LEN,
5228 __tmp.remaining(),
5229 )
5230 }
5231 __tmp.put_u64_le(self.timestamp);
5232 __tmp.put_f32_le(self.h);
5233 __tmp.put_f32_le(self.hRef);
5234 __tmp.put_f32_le(self.hRef_t);
5235 __tmp.put_f32_le(self.PitchAngle);
5236 __tmp.put_f32_le(self.PitchAngleRef);
5237 __tmp.put_f32_le(self.q);
5238 __tmp.put_f32_le(self.qRef);
5239 __tmp.put_f32_le(self.uElev);
5240 __tmp.put_f32_le(self.uThrot);
5241 __tmp.put_f32_le(self.uThrot2);
5242 __tmp.put_f32_le(self.nZ);
5243 __tmp.put_f32_le(self.AirspeedRef);
5244 __tmp.put_f32_le(self.YawAngle);
5245 __tmp.put_f32_le(self.YawAngleRef);
5246 __tmp.put_f32_le(self.RollAngle);
5247 __tmp.put_f32_le(self.RollAngleRef);
5248 __tmp.put_f32_le(self.p);
5249 __tmp.put_f32_le(self.pRef);
5250 __tmp.put_f32_le(self.r);
5251 __tmp.put_f32_le(self.rRef);
5252 __tmp.put_f32_le(self.uAil);
5253 __tmp.put_f32_le(self.uRud);
5254 __tmp.put_u8(self.aslctrl_mode);
5255 __tmp.put_u8(self.SpoilersEngaged);
5256 if matches!(version, MavlinkVersion::V2) {
5257 let len = __tmp.len();
5258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5259 } else {
5260 __tmp.len()
5261 }
5262 }
5263}
5264#[doc = "id: 8005"]
5265#[doc = "ASL-fixed-wing controller debug data."]
5266#[derive(Debug, Clone, PartialEq)]
5267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5269pub struct ASLCTRL_DEBUG_DATA {
5270 #[doc = "Debug data"]
5271 pub i32_1: u32,
5272 #[doc = "Debug data"]
5273 pub f_1: f32,
5274 #[doc = "Debug data"]
5275 pub f_2: f32,
5276 #[doc = "Debug data"]
5277 pub f_3: f32,
5278 #[doc = "Debug data"]
5279 pub f_4: f32,
5280 #[doc = "Debug data"]
5281 pub f_5: f32,
5282 #[doc = "Debug data"]
5283 pub f_6: f32,
5284 #[doc = "Debug data"]
5285 pub f_7: f32,
5286 #[doc = "Debug data"]
5287 pub f_8: f32,
5288 #[doc = "Debug data"]
5289 pub i8_1: u8,
5290 #[doc = "Debug data"]
5291 pub i8_2: u8,
5292}
5293impl ASLCTRL_DEBUG_DATA {
5294 pub const ENCODED_LEN: usize = 38usize;
5295 pub const DEFAULT: Self = Self {
5296 i32_1: 0_u32,
5297 f_1: 0.0_f32,
5298 f_2: 0.0_f32,
5299 f_3: 0.0_f32,
5300 f_4: 0.0_f32,
5301 f_5: 0.0_f32,
5302 f_6: 0.0_f32,
5303 f_7: 0.0_f32,
5304 f_8: 0.0_f32,
5305 i8_1: 0_u8,
5306 i8_2: 0_u8,
5307 };
5308 #[cfg(feature = "arbitrary")]
5309 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5310 use arbitrary::{Arbitrary, Unstructured};
5311 let mut buf = [0u8; 1024];
5312 rng.fill_bytes(&mut buf);
5313 let mut unstructured = Unstructured::new(&buf);
5314 Self::arbitrary(&mut unstructured).unwrap_or_default()
5315 }
5316}
5317impl Default for ASLCTRL_DEBUG_DATA {
5318 fn default() -> Self {
5319 Self::DEFAULT.clone()
5320 }
5321}
5322impl MessageData for ASLCTRL_DEBUG_DATA {
5323 type Message = MavMessage;
5324 const ID: u32 = 8005u32;
5325 const NAME: &'static str = "ASLCTRL_DEBUG";
5326 const EXTRA_CRC: u8 = 251u8;
5327 const ENCODED_LEN: usize = 38usize;
5328 fn deser(
5329 _version: MavlinkVersion,
5330 __input: &[u8],
5331 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5332 let avail_len = __input.len();
5333 let mut payload_buf = [0; Self::ENCODED_LEN];
5334 let mut buf = if avail_len < Self::ENCODED_LEN {
5335 payload_buf[0..avail_len].copy_from_slice(__input);
5336 Bytes::new(&payload_buf)
5337 } else {
5338 Bytes::new(__input)
5339 };
5340 let mut __struct = Self::default();
5341 __struct.i32_1 = buf.get_u32_le();
5342 __struct.f_1 = buf.get_f32_le();
5343 __struct.f_2 = buf.get_f32_le();
5344 __struct.f_3 = buf.get_f32_le();
5345 __struct.f_4 = buf.get_f32_le();
5346 __struct.f_5 = buf.get_f32_le();
5347 __struct.f_6 = buf.get_f32_le();
5348 __struct.f_7 = buf.get_f32_le();
5349 __struct.f_8 = buf.get_f32_le();
5350 __struct.i8_1 = buf.get_u8();
5351 __struct.i8_2 = buf.get_u8();
5352 Ok(__struct)
5353 }
5354 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5355 let mut __tmp = BytesMut::new(bytes);
5356 #[allow(clippy::absurd_extreme_comparisons)]
5357 #[allow(unused_comparisons)]
5358 if __tmp.remaining() < Self::ENCODED_LEN {
5359 panic!(
5360 "buffer is too small (need {} bytes, but got {})",
5361 Self::ENCODED_LEN,
5362 __tmp.remaining(),
5363 )
5364 }
5365 __tmp.put_u32_le(self.i32_1);
5366 __tmp.put_f32_le(self.f_1);
5367 __tmp.put_f32_le(self.f_2);
5368 __tmp.put_f32_le(self.f_3);
5369 __tmp.put_f32_le(self.f_4);
5370 __tmp.put_f32_le(self.f_5);
5371 __tmp.put_f32_le(self.f_6);
5372 __tmp.put_f32_le(self.f_7);
5373 __tmp.put_f32_le(self.f_8);
5374 __tmp.put_u8(self.i8_1);
5375 __tmp.put_u8(self.i8_2);
5376 if matches!(version, MavlinkVersion::V2) {
5377 let len = __tmp.len();
5378 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5379 } else {
5380 __tmp.len()
5381 }
5382 }
5383}
5384#[doc = "id: 8006"]
5385#[doc = "Extended state information for ASLUAVs."]
5386#[derive(Debug, Clone, PartialEq)]
5387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5388#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5389pub struct ASLUAV_STATUS_DATA {
5390 #[doc = "Motor RPM"]
5391 pub Motor_rpm: f32,
5392 #[doc = "Status of the position-indicator LEDs"]
5393 pub LED_status: u8,
5394 #[doc = "Status of the IRIDIUM satellite communication system"]
5395 pub SATCOM_status: u8,
5396 #[doc = "Status vector for up to 8 servos"]
5397 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5398 pub Servo_status: [u8; 8],
5399}
5400impl ASLUAV_STATUS_DATA {
5401 pub const ENCODED_LEN: usize = 14usize;
5402 pub const DEFAULT: Self = Self {
5403 Motor_rpm: 0.0_f32,
5404 LED_status: 0_u8,
5405 SATCOM_status: 0_u8,
5406 Servo_status: [0_u8; 8usize],
5407 };
5408 #[cfg(feature = "arbitrary")]
5409 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5410 use arbitrary::{Arbitrary, Unstructured};
5411 let mut buf = [0u8; 1024];
5412 rng.fill_bytes(&mut buf);
5413 let mut unstructured = Unstructured::new(&buf);
5414 Self::arbitrary(&mut unstructured).unwrap_or_default()
5415 }
5416}
5417impl Default for ASLUAV_STATUS_DATA {
5418 fn default() -> Self {
5419 Self::DEFAULT.clone()
5420 }
5421}
5422impl MessageData for ASLUAV_STATUS_DATA {
5423 type Message = MavMessage;
5424 const ID: u32 = 8006u32;
5425 const NAME: &'static str = "ASLUAV_STATUS";
5426 const EXTRA_CRC: u8 = 97u8;
5427 const ENCODED_LEN: usize = 14usize;
5428 fn deser(
5429 _version: MavlinkVersion,
5430 __input: &[u8],
5431 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5432 let avail_len = __input.len();
5433 let mut payload_buf = [0; Self::ENCODED_LEN];
5434 let mut buf = if avail_len < Self::ENCODED_LEN {
5435 payload_buf[0..avail_len].copy_from_slice(__input);
5436 Bytes::new(&payload_buf)
5437 } else {
5438 Bytes::new(__input)
5439 };
5440 let mut __struct = Self::default();
5441 __struct.Motor_rpm = buf.get_f32_le();
5442 __struct.LED_status = buf.get_u8();
5443 __struct.SATCOM_status = buf.get_u8();
5444 for v in &mut __struct.Servo_status {
5445 let val = buf.get_u8();
5446 *v = val;
5447 }
5448 Ok(__struct)
5449 }
5450 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5451 let mut __tmp = BytesMut::new(bytes);
5452 #[allow(clippy::absurd_extreme_comparisons)]
5453 #[allow(unused_comparisons)]
5454 if __tmp.remaining() < Self::ENCODED_LEN {
5455 panic!(
5456 "buffer is too small (need {} bytes, but got {})",
5457 Self::ENCODED_LEN,
5458 __tmp.remaining(),
5459 )
5460 }
5461 __tmp.put_f32_le(self.Motor_rpm);
5462 __tmp.put_u8(self.LED_status);
5463 __tmp.put_u8(self.SATCOM_status);
5464 for val in &self.Servo_status {
5465 __tmp.put_u8(*val);
5466 }
5467 if matches!(version, MavlinkVersion::V2) {
5468 let len = __tmp.len();
5469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5470 } else {
5471 __tmp.len()
5472 }
5473 }
5474}
5475#[doc = "id: 8008"]
5476#[doc = "Off-board controls/commands for ASLUAVs."]
5477#[derive(Debug, Clone, PartialEq)]
5478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5480pub struct ASL_OBCTRL_DATA {
5481 #[doc = "Time since system start"]
5482 pub timestamp: u64,
5483 #[doc = "Elevator command [~]"]
5484 pub uElev: f32,
5485 #[doc = "Throttle command [~]"]
5486 pub uThrot: f32,
5487 #[doc = "Throttle 2 command [~]"]
5488 pub uThrot2: f32,
5489 #[doc = "Left aileron command [~]"]
5490 pub uAilL: f32,
5491 #[doc = "Right aileron command [~]"]
5492 pub uAilR: f32,
5493 #[doc = "Rudder command [~]"]
5494 pub uRud: f32,
5495 #[doc = "Off-board computer status"]
5496 pub obctrl_status: u8,
5497}
5498impl ASL_OBCTRL_DATA {
5499 pub const ENCODED_LEN: usize = 33usize;
5500 pub const DEFAULT: Self = Self {
5501 timestamp: 0_u64,
5502 uElev: 0.0_f32,
5503 uThrot: 0.0_f32,
5504 uThrot2: 0.0_f32,
5505 uAilL: 0.0_f32,
5506 uAilR: 0.0_f32,
5507 uRud: 0.0_f32,
5508 obctrl_status: 0_u8,
5509 };
5510 #[cfg(feature = "arbitrary")]
5511 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5512 use arbitrary::{Arbitrary, Unstructured};
5513 let mut buf = [0u8; 1024];
5514 rng.fill_bytes(&mut buf);
5515 let mut unstructured = Unstructured::new(&buf);
5516 Self::arbitrary(&mut unstructured).unwrap_or_default()
5517 }
5518}
5519impl Default for ASL_OBCTRL_DATA {
5520 fn default() -> Self {
5521 Self::DEFAULT.clone()
5522 }
5523}
5524impl MessageData for ASL_OBCTRL_DATA {
5525 type Message = MavMessage;
5526 const ID: u32 = 8008u32;
5527 const NAME: &'static str = "ASL_OBCTRL";
5528 const EXTRA_CRC: u8 = 234u8;
5529 const ENCODED_LEN: usize = 33usize;
5530 fn deser(
5531 _version: MavlinkVersion,
5532 __input: &[u8],
5533 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5534 let avail_len = __input.len();
5535 let mut payload_buf = [0; Self::ENCODED_LEN];
5536 let mut buf = if avail_len < Self::ENCODED_LEN {
5537 payload_buf[0..avail_len].copy_from_slice(__input);
5538 Bytes::new(&payload_buf)
5539 } else {
5540 Bytes::new(__input)
5541 };
5542 let mut __struct = Self::default();
5543 __struct.timestamp = buf.get_u64_le();
5544 __struct.uElev = buf.get_f32_le();
5545 __struct.uThrot = buf.get_f32_le();
5546 __struct.uThrot2 = buf.get_f32_le();
5547 __struct.uAilL = buf.get_f32_le();
5548 __struct.uAilR = buf.get_f32_le();
5549 __struct.uRud = buf.get_f32_le();
5550 __struct.obctrl_status = buf.get_u8();
5551 Ok(__struct)
5552 }
5553 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5554 let mut __tmp = BytesMut::new(bytes);
5555 #[allow(clippy::absurd_extreme_comparisons)]
5556 #[allow(unused_comparisons)]
5557 if __tmp.remaining() < Self::ENCODED_LEN {
5558 panic!(
5559 "buffer is too small (need {} bytes, but got {})",
5560 Self::ENCODED_LEN,
5561 __tmp.remaining(),
5562 )
5563 }
5564 __tmp.put_u64_le(self.timestamp);
5565 __tmp.put_f32_le(self.uElev);
5566 __tmp.put_f32_le(self.uThrot);
5567 __tmp.put_f32_le(self.uThrot2);
5568 __tmp.put_f32_le(self.uAilL);
5569 __tmp.put_f32_le(self.uAilR);
5570 __tmp.put_f32_le(self.uRud);
5571 __tmp.put_u8(self.obctrl_status);
5572 if matches!(version, MavlinkVersion::V2) {
5573 let len = __tmp.len();
5574 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5575 } else {
5576 __tmp.len()
5577 }
5578 }
5579}
5580#[doc = "id: 30"]
5581#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5582#[derive(Debug, Clone, PartialEq)]
5583#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5585pub struct ATTITUDE_DATA {
5586 #[doc = "Timestamp (time since system boot)."]
5587 pub time_boot_ms: u32,
5588 #[doc = "Roll angle (-pi..+pi)"]
5589 pub roll: f32,
5590 #[doc = "Pitch angle (-pi..+pi)"]
5591 pub pitch: f32,
5592 #[doc = "Yaw angle (-pi..+pi)"]
5593 pub yaw: f32,
5594 #[doc = "Roll angular speed"]
5595 pub rollspeed: f32,
5596 #[doc = "Pitch angular speed"]
5597 pub pitchspeed: f32,
5598 #[doc = "Yaw angular speed"]
5599 pub yawspeed: f32,
5600}
5601impl ATTITUDE_DATA {
5602 pub const ENCODED_LEN: usize = 28usize;
5603 pub const DEFAULT: Self = Self {
5604 time_boot_ms: 0_u32,
5605 roll: 0.0_f32,
5606 pitch: 0.0_f32,
5607 yaw: 0.0_f32,
5608 rollspeed: 0.0_f32,
5609 pitchspeed: 0.0_f32,
5610 yawspeed: 0.0_f32,
5611 };
5612 #[cfg(feature = "arbitrary")]
5613 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5614 use arbitrary::{Arbitrary, Unstructured};
5615 let mut buf = [0u8; 1024];
5616 rng.fill_bytes(&mut buf);
5617 let mut unstructured = Unstructured::new(&buf);
5618 Self::arbitrary(&mut unstructured).unwrap_or_default()
5619 }
5620}
5621impl Default for ATTITUDE_DATA {
5622 fn default() -> Self {
5623 Self::DEFAULT.clone()
5624 }
5625}
5626impl MessageData for ATTITUDE_DATA {
5627 type Message = MavMessage;
5628 const ID: u32 = 30u32;
5629 const NAME: &'static str = "ATTITUDE";
5630 const EXTRA_CRC: u8 = 39u8;
5631 const ENCODED_LEN: usize = 28usize;
5632 fn deser(
5633 _version: MavlinkVersion,
5634 __input: &[u8],
5635 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5636 let avail_len = __input.len();
5637 let mut payload_buf = [0; Self::ENCODED_LEN];
5638 let mut buf = if avail_len < Self::ENCODED_LEN {
5639 payload_buf[0..avail_len].copy_from_slice(__input);
5640 Bytes::new(&payload_buf)
5641 } else {
5642 Bytes::new(__input)
5643 };
5644 let mut __struct = Self::default();
5645 __struct.time_boot_ms = buf.get_u32_le();
5646 __struct.roll = buf.get_f32_le();
5647 __struct.pitch = buf.get_f32_le();
5648 __struct.yaw = buf.get_f32_le();
5649 __struct.rollspeed = buf.get_f32_le();
5650 __struct.pitchspeed = buf.get_f32_le();
5651 __struct.yawspeed = buf.get_f32_le();
5652 Ok(__struct)
5653 }
5654 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5655 let mut __tmp = BytesMut::new(bytes);
5656 #[allow(clippy::absurd_extreme_comparisons)]
5657 #[allow(unused_comparisons)]
5658 if __tmp.remaining() < Self::ENCODED_LEN {
5659 panic!(
5660 "buffer is too small (need {} bytes, but got {})",
5661 Self::ENCODED_LEN,
5662 __tmp.remaining(),
5663 )
5664 }
5665 __tmp.put_u32_le(self.time_boot_ms);
5666 __tmp.put_f32_le(self.roll);
5667 __tmp.put_f32_le(self.pitch);
5668 __tmp.put_f32_le(self.yaw);
5669 __tmp.put_f32_le(self.rollspeed);
5670 __tmp.put_f32_le(self.pitchspeed);
5671 __tmp.put_f32_le(self.yawspeed);
5672 if matches!(version, MavlinkVersion::V2) {
5673 let len = __tmp.len();
5674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5675 } else {
5676 __tmp.len()
5677 }
5678 }
5679}
5680#[doc = "id: 31"]
5681#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5682#[derive(Debug, Clone, PartialEq)]
5683#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5685pub struct ATTITUDE_QUATERNION_DATA {
5686 #[doc = "Timestamp (time since system boot)."]
5687 pub time_boot_ms: u32,
5688 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5689 pub q1: f32,
5690 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5691 pub q2: f32,
5692 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5693 pub q3: f32,
5694 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5695 pub q4: f32,
5696 #[doc = "Roll angular speed"]
5697 pub rollspeed: f32,
5698 #[doc = "Pitch angular speed"]
5699 pub pitchspeed: f32,
5700 #[doc = "Yaw angular speed"]
5701 pub yawspeed: f32,
5702 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5703 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5704 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5705 pub repr_offset_q: [f32; 4],
5706}
5707impl ATTITUDE_QUATERNION_DATA {
5708 pub const ENCODED_LEN: usize = 48usize;
5709 pub const DEFAULT: Self = Self {
5710 time_boot_ms: 0_u32,
5711 q1: 0.0_f32,
5712 q2: 0.0_f32,
5713 q3: 0.0_f32,
5714 q4: 0.0_f32,
5715 rollspeed: 0.0_f32,
5716 pitchspeed: 0.0_f32,
5717 yawspeed: 0.0_f32,
5718 repr_offset_q: [0.0_f32; 4usize],
5719 };
5720 #[cfg(feature = "arbitrary")]
5721 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5722 use arbitrary::{Arbitrary, Unstructured};
5723 let mut buf = [0u8; 1024];
5724 rng.fill_bytes(&mut buf);
5725 let mut unstructured = Unstructured::new(&buf);
5726 Self::arbitrary(&mut unstructured).unwrap_or_default()
5727 }
5728}
5729impl Default for ATTITUDE_QUATERNION_DATA {
5730 fn default() -> Self {
5731 Self::DEFAULT.clone()
5732 }
5733}
5734impl MessageData for ATTITUDE_QUATERNION_DATA {
5735 type Message = MavMessage;
5736 const ID: u32 = 31u32;
5737 const NAME: &'static str = "ATTITUDE_QUATERNION";
5738 const EXTRA_CRC: u8 = 246u8;
5739 const ENCODED_LEN: usize = 48usize;
5740 fn deser(
5741 _version: MavlinkVersion,
5742 __input: &[u8],
5743 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5744 let avail_len = __input.len();
5745 let mut payload_buf = [0; Self::ENCODED_LEN];
5746 let mut buf = if avail_len < Self::ENCODED_LEN {
5747 payload_buf[0..avail_len].copy_from_slice(__input);
5748 Bytes::new(&payload_buf)
5749 } else {
5750 Bytes::new(__input)
5751 };
5752 let mut __struct = Self::default();
5753 __struct.time_boot_ms = buf.get_u32_le();
5754 __struct.q1 = buf.get_f32_le();
5755 __struct.q2 = buf.get_f32_le();
5756 __struct.q3 = buf.get_f32_le();
5757 __struct.q4 = buf.get_f32_le();
5758 __struct.rollspeed = buf.get_f32_le();
5759 __struct.pitchspeed = buf.get_f32_le();
5760 __struct.yawspeed = buf.get_f32_le();
5761 for v in &mut __struct.repr_offset_q {
5762 let val = buf.get_f32_le();
5763 *v = val;
5764 }
5765 Ok(__struct)
5766 }
5767 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5768 let mut __tmp = BytesMut::new(bytes);
5769 #[allow(clippy::absurd_extreme_comparisons)]
5770 #[allow(unused_comparisons)]
5771 if __tmp.remaining() < Self::ENCODED_LEN {
5772 panic!(
5773 "buffer is too small (need {} bytes, but got {})",
5774 Self::ENCODED_LEN,
5775 __tmp.remaining(),
5776 )
5777 }
5778 __tmp.put_u32_le(self.time_boot_ms);
5779 __tmp.put_f32_le(self.q1);
5780 __tmp.put_f32_le(self.q2);
5781 __tmp.put_f32_le(self.q3);
5782 __tmp.put_f32_le(self.q4);
5783 __tmp.put_f32_le(self.rollspeed);
5784 __tmp.put_f32_le(self.pitchspeed);
5785 __tmp.put_f32_le(self.yawspeed);
5786 for val in &self.repr_offset_q {
5787 __tmp.put_f32_le(*val);
5788 }
5789 if matches!(version, MavlinkVersion::V2) {
5790 let len = __tmp.len();
5791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5792 } else {
5793 __tmp.len()
5794 }
5795 }
5796}
5797#[doc = "id: 61"]
5798#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5799#[derive(Debug, Clone, PartialEq)]
5800#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5801#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5802pub struct ATTITUDE_QUATERNION_COV_DATA {
5803 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5804 pub time_usec: u64,
5805 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5806 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5807 pub q: [f32; 4],
5808 #[doc = "Roll angular speed"]
5809 pub rollspeed: f32,
5810 #[doc = "Pitch angular speed"]
5811 pub pitchspeed: f32,
5812 #[doc = "Yaw angular speed"]
5813 pub yawspeed: f32,
5814 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5815 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5816 pub covariance: [f32; 9],
5817}
5818impl ATTITUDE_QUATERNION_COV_DATA {
5819 pub const ENCODED_LEN: usize = 72usize;
5820 pub const DEFAULT: Self = Self {
5821 time_usec: 0_u64,
5822 q: [0.0_f32; 4usize],
5823 rollspeed: 0.0_f32,
5824 pitchspeed: 0.0_f32,
5825 yawspeed: 0.0_f32,
5826 covariance: [0.0_f32; 9usize],
5827 };
5828 #[cfg(feature = "arbitrary")]
5829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5830 use arbitrary::{Arbitrary, Unstructured};
5831 let mut buf = [0u8; 1024];
5832 rng.fill_bytes(&mut buf);
5833 let mut unstructured = Unstructured::new(&buf);
5834 Self::arbitrary(&mut unstructured).unwrap_or_default()
5835 }
5836}
5837impl Default for ATTITUDE_QUATERNION_COV_DATA {
5838 fn default() -> Self {
5839 Self::DEFAULT.clone()
5840 }
5841}
5842impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5843 type Message = MavMessage;
5844 const ID: u32 = 61u32;
5845 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5846 const EXTRA_CRC: u8 = 167u8;
5847 const ENCODED_LEN: usize = 72usize;
5848 fn deser(
5849 _version: MavlinkVersion,
5850 __input: &[u8],
5851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5852 let avail_len = __input.len();
5853 let mut payload_buf = [0; Self::ENCODED_LEN];
5854 let mut buf = if avail_len < Self::ENCODED_LEN {
5855 payload_buf[0..avail_len].copy_from_slice(__input);
5856 Bytes::new(&payload_buf)
5857 } else {
5858 Bytes::new(__input)
5859 };
5860 let mut __struct = Self::default();
5861 __struct.time_usec = buf.get_u64_le();
5862 for v in &mut __struct.q {
5863 let val = buf.get_f32_le();
5864 *v = val;
5865 }
5866 __struct.rollspeed = buf.get_f32_le();
5867 __struct.pitchspeed = buf.get_f32_le();
5868 __struct.yawspeed = buf.get_f32_le();
5869 for v in &mut __struct.covariance {
5870 let val = buf.get_f32_le();
5871 *v = val;
5872 }
5873 Ok(__struct)
5874 }
5875 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5876 let mut __tmp = BytesMut::new(bytes);
5877 #[allow(clippy::absurd_extreme_comparisons)]
5878 #[allow(unused_comparisons)]
5879 if __tmp.remaining() < Self::ENCODED_LEN {
5880 panic!(
5881 "buffer is too small (need {} bytes, but got {})",
5882 Self::ENCODED_LEN,
5883 __tmp.remaining(),
5884 )
5885 }
5886 __tmp.put_u64_le(self.time_usec);
5887 for val in &self.q {
5888 __tmp.put_f32_le(*val);
5889 }
5890 __tmp.put_f32_le(self.rollspeed);
5891 __tmp.put_f32_le(self.pitchspeed);
5892 __tmp.put_f32_le(self.yawspeed);
5893 for val in &self.covariance {
5894 __tmp.put_f32_le(*val);
5895 }
5896 if matches!(version, MavlinkVersion::V2) {
5897 let len = __tmp.len();
5898 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5899 } else {
5900 __tmp.len()
5901 }
5902 }
5903}
5904#[doc = "id: 83"]
5905#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5906#[derive(Debug, Clone, PartialEq)]
5907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5909pub struct ATTITUDE_TARGET_DATA {
5910 #[doc = "Timestamp (time since system boot)."]
5911 pub time_boot_ms: u32,
5912 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5913 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5914 pub q: [f32; 4],
5915 #[doc = "Body roll rate"]
5916 pub body_roll_rate: f32,
5917 #[doc = "Body pitch rate"]
5918 pub body_pitch_rate: f32,
5919 #[doc = "Body yaw rate"]
5920 pub body_yaw_rate: f32,
5921 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5922 pub thrust: f32,
5923 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5924 pub type_mask: AttitudeTargetTypemask,
5925}
5926impl ATTITUDE_TARGET_DATA {
5927 pub const ENCODED_LEN: usize = 37usize;
5928 pub const DEFAULT: Self = Self {
5929 time_boot_ms: 0_u32,
5930 q: [0.0_f32; 4usize],
5931 body_roll_rate: 0.0_f32,
5932 body_pitch_rate: 0.0_f32,
5933 body_yaw_rate: 0.0_f32,
5934 thrust: 0.0_f32,
5935 type_mask: AttitudeTargetTypemask::DEFAULT,
5936 };
5937 #[cfg(feature = "arbitrary")]
5938 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5939 use arbitrary::{Arbitrary, Unstructured};
5940 let mut buf = [0u8; 1024];
5941 rng.fill_bytes(&mut buf);
5942 let mut unstructured = Unstructured::new(&buf);
5943 Self::arbitrary(&mut unstructured).unwrap_or_default()
5944 }
5945}
5946impl Default for ATTITUDE_TARGET_DATA {
5947 fn default() -> Self {
5948 Self::DEFAULT.clone()
5949 }
5950}
5951impl MessageData for ATTITUDE_TARGET_DATA {
5952 type Message = MavMessage;
5953 const ID: u32 = 83u32;
5954 const NAME: &'static str = "ATTITUDE_TARGET";
5955 const EXTRA_CRC: u8 = 22u8;
5956 const ENCODED_LEN: usize = 37usize;
5957 fn deser(
5958 _version: MavlinkVersion,
5959 __input: &[u8],
5960 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5961 let avail_len = __input.len();
5962 let mut payload_buf = [0; Self::ENCODED_LEN];
5963 let mut buf = if avail_len < Self::ENCODED_LEN {
5964 payload_buf[0..avail_len].copy_from_slice(__input);
5965 Bytes::new(&payload_buf)
5966 } else {
5967 Bytes::new(__input)
5968 };
5969 let mut __struct = Self::default();
5970 __struct.time_boot_ms = buf.get_u32_le();
5971 for v in &mut __struct.q {
5972 let val = buf.get_f32_le();
5973 *v = val;
5974 }
5975 __struct.body_roll_rate = buf.get_f32_le();
5976 __struct.body_pitch_rate = buf.get_f32_le();
5977 __struct.body_yaw_rate = buf.get_f32_le();
5978 __struct.thrust = buf.get_f32_le();
5979 let tmp = buf.get_u8();
5980 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5981 tmp & AttitudeTargetTypemask::all().bits(),
5982 )
5983 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5984 flag_type: "AttitudeTargetTypemask",
5985 value: tmp as u32,
5986 })?;
5987 Ok(__struct)
5988 }
5989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5990 let mut __tmp = BytesMut::new(bytes);
5991 #[allow(clippy::absurd_extreme_comparisons)]
5992 #[allow(unused_comparisons)]
5993 if __tmp.remaining() < Self::ENCODED_LEN {
5994 panic!(
5995 "buffer is too small (need {} bytes, but got {})",
5996 Self::ENCODED_LEN,
5997 __tmp.remaining(),
5998 )
5999 }
6000 __tmp.put_u32_le(self.time_boot_ms);
6001 for val in &self.q {
6002 __tmp.put_f32_le(*val);
6003 }
6004 __tmp.put_f32_le(self.body_roll_rate);
6005 __tmp.put_f32_le(self.body_pitch_rate);
6006 __tmp.put_f32_le(self.body_yaw_rate);
6007 __tmp.put_f32_le(self.thrust);
6008 __tmp.put_u8(self.type_mask.bits());
6009 if matches!(version, MavlinkVersion::V2) {
6010 let len = __tmp.len();
6011 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6012 } else {
6013 __tmp.len()
6014 }
6015 }
6016}
6017#[doc = "id: 138"]
6018#[doc = "Motion capture attitude and position."]
6019#[derive(Debug, Clone, PartialEq)]
6020#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6021#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6022pub struct ATT_POS_MOCAP_DATA {
6023 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6024 pub time_usec: u64,
6025 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6026 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6027 pub q: [f32; 4],
6028 #[doc = "X position (NED)"]
6029 pub x: f32,
6030 #[doc = "Y position (NED)"]
6031 pub y: f32,
6032 #[doc = "Z position (NED)"]
6033 pub z: f32,
6034 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
6035 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6036 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6037 pub covariance: [f32; 21],
6038}
6039impl ATT_POS_MOCAP_DATA {
6040 pub const ENCODED_LEN: usize = 120usize;
6041 pub const DEFAULT: Self = Self {
6042 time_usec: 0_u64,
6043 q: [0.0_f32; 4usize],
6044 x: 0.0_f32,
6045 y: 0.0_f32,
6046 z: 0.0_f32,
6047 covariance: [0.0_f32; 21usize],
6048 };
6049 #[cfg(feature = "arbitrary")]
6050 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6051 use arbitrary::{Arbitrary, Unstructured};
6052 let mut buf = [0u8; 1024];
6053 rng.fill_bytes(&mut buf);
6054 let mut unstructured = Unstructured::new(&buf);
6055 Self::arbitrary(&mut unstructured).unwrap_or_default()
6056 }
6057}
6058impl Default for ATT_POS_MOCAP_DATA {
6059 fn default() -> Self {
6060 Self::DEFAULT.clone()
6061 }
6062}
6063impl MessageData for ATT_POS_MOCAP_DATA {
6064 type Message = MavMessage;
6065 const ID: u32 = 138u32;
6066 const NAME: &'static str = "ATT_POS_MOCAP";
6067 const EXTRA_CRC: u8 = 109u8;
6068 const ENCODED_LEN: usize = 120usize;
6069 fn deser(
6070 _version: MavlinkVersion,
6071 __input: &[u8],
6072 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6073 let avail_len = __input.len();
6074 let mut payload_buf = [0; Self::ENCODED_LEN];
6075 let mut buf = if avail_len < Self::ENCODED_LEN {
6076 payload_buf[0..avail_len].copy_from_slice(__input);
6077 Bytes::new(&payload_buf)
6078 } else {
6079 Bytes::new(__input)
6080 };
6081 let mut __struct = Self::default();
6082 __struct.time_usec = buf.get_u64_le();
6083 for v in &mut __struct.q {
6084 let val = buf.get_f32_le();
6085 *v = val;
6086 }
6087 __struct.x = buf.get_f32_le();
6088 __struct.y = buf.get_f32_le();
6089 __struct.z = buf.get_f32_le();
6090 for v in &mut __struct.covariance {
6091 let val = buf.get_f32_le();
6092 *v = val;
6093 }
6094 Ok(__struct)
6095 }
6096 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6097 let mut __tmp = BytesMut::new(bytes);
6098 #[allow(clippy::absurd_extreme_comparisons)]
6099 #[allow(unused_comparisons)]
6100 if __tmp.remaining() < Self::ENCODED_LEN {
6101 panic!(
6102 "buffer is too small (need {} bytes, but got {})",
6103 Self::ENCODED_LEN,
6104 __tmp.remaining(),
6105 )
6106 }
6107 __tmp.put_u64_le(self.time_usec);
6108 for val in &self.q {
6109 __tmp.put_f32_le(*val);
6110 }
6111 __tmp.put_f32_le(self.x);
6112 __tmp.put_f32_le(self.y);
6113 __tmp.put_f32_le(self.z);
6114 for val in &self.covariance {
6115 __tmp.put_f32_le(*val);
6116 }
6117 if matches!(version, MavlinkVersion::V2) {
6118 let len = __tmp.len();
6119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6120 } else {
6121 __tmp.len()
6122 }
6123 }
6124}
6125#[doc = "id: 7"]
6126#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
6127#[derive(Debug, Clone, PartialEq)]
6128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6129#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6130pub struct AUTH_KEY_DATA {
6131 #[doc = "key"]
6132 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6133 pub key: [u8; 32],
6134}
6135impl AUTH_KEY_DATA {
6136 pub const ENCODED_LEN: usize = 32usize;
6137 pub const DEFAULT: Self = Self {
6138 key: [0_u8; 32usize],
6139 };
6140 #[cfg(feature = "arbitrary")]
6141 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6142 use arbitrary::{Arbitrary, Unstructured};
6143 let mut buf = [0u8; 1024];
6144 rng.fill_bytes(&mut buf);
6145 let mut unstructured = Unstructured::new(&buf);
6146 Self::arbitrary(&mut unstructured).unwrap_or_default()
6147 }
6148}
6149impl Default for AUTH_KEY_DATA {
6150 fn default() -> Self {
6151 Self::DEFAULT.clone()
6152 }
6153}
6154impl MessageData for AUTH_KEY_DATA {
6155 type Message = MavMessage;
6156 const ID: u32 = 7u32;
6157 const NAME: &'static str = "AUTH_KEY";
6158 const EXTRA_CRC: u8 = 119u8;
6159 const ENCODED_LEN: usize = 32usize;
6160 fn deser(
6161 _version: MavlinkVersion,
6162 __input: &[u8],
6163 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6164 let avail_len = __input.len();
6165 let mut payload_buf = [0; Self::ENCODED_LEN];
6166 let mut buf = if avail_len < Self::ENCODED_LEN {
6167 payload_buf[0..avail_len].copy_from_slice(__input);
6168 Bytes::new(&payload_buf)
6169 } else {
6170 Bytes::new(__input)
6171 };
6172 let mut __struct = Self::default();
6173 for v in &mut __struct.key {
6174 let val = buf.get_u8();
6175 *v = val;
6176 }
6177 Ok(__struct)
6178 }
6179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6180 let mut __tmp = BytesMut::new(bytes);
6181 #[allow(clippy::absurd_extreme_comparisons)]
6182 #[allow(unused_comparisons)]
6183 if __tmp.remaining() < Self::ENCODED_LEN {
6184 panic!(
6185 "buffer is too small (need {} bytes, but got {})",
6186 Self::ENCODED_LEN,
6187 __tmp.remaining(),
6188 )
6189 }
6190 for val in &self.key {
6191 __tmp.put_u8(*val);
6192 }
6193 if matches!(version, MavlinkVersion::V2) {
6194 let len = __tmp.len();
6195 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6196 } else {
6197 __tmp.len()
6198 }
6199 }
6200}
6201#[doc = "id: 286"]
6202#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6203#[derive(Debug, Clone, PartialEq)]
6204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6206pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6207 #[doc = "Timestamp (time since system boot)."]
6208 pub time_boot_us: u64,
6209 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6210 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6211 pub q: [f32; 4],
6212 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6213 pub q_estimated_delay_us: u32,
6214 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6215 pub vx: f32,
6216 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6217 pub vy: f32,
6218 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6219 pub vz: f32,
6220 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6221 pub v_estimated_delay_us: u32,
6222 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6223 pub feed_forward_angular_velocity_z: f32,
6224 #[doc = "Bitmap indicating which estimator outputs are valid."]
6225 pub estimator_status: EstimatorStatusFlags,
6226 #[doc = "System ID"]
6227 pub target_system: u8,
6228 #[doc = "Component ID"]
6229 pub target_component: u8,
6230 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6231 pub landed_state: MavLandedState,
6232 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6233 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6234 pub angular_velocity_z: f32,
6235}
6236impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6237 pub const ENCODED_LEN: usize = 57usize;
6238 pub const DEFAULT: Self = Self {
6239 time_boot_us: 0_u64,
6240 q: [0.0_f32; 4usize],
6241 q_estimated_delay_us: 0_u32,
6242 vx: 0.0_f32,
6243 vy: 0.0_f32,
6244 vz: 0.0_f32,
6245 v_estimated_delay_us: 0_u32,
6246 feed_forward_angular_velocity_z: 0.0_f32,
6247 estimator_status: EstimatorStatusFlags::DEFAULT,
6248 target_system: 0_u8,
6249 target_component: 0_u8,
6250 landed_state: MavLandedState::DEFAULT,
6251 angular_velocity_z: 0.0_f32,
6252 };
6253 #[cfg(feature = "arbitrary")]
6254 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6255 use arbitrary::{Arbitrary, Unstructured};
6256 let mut buf = [0u8; 1024];
6257 rng.fill_bytes(&mut buf);
6258 let mut unstructured = Unstructured::new(&buf);
6259 Self::arbitrary(&mut unstructured).unwrap_or_default()
6260 }
6261}
6262impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6263 fn default() -> Self {
6264 Self::DEFAULT.clone()
6265 }
6266}
6267impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6268 type Message = MavMessage;
6269 const ID: u32 = 286u32;
6270 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6271 const EXTRA_CRC: u8 = 210u8;
6272 const ENCODED_LEN: usize = 57usize;
6273 fn deser(
6274 _version: MavlinkVersion,
6275 __input: &[u8],
6276 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6277 let avail_len = __input.len();
6278 let mut payload_buf = [0; Self::ENCODED_LEN];
6279 let mut buf = if avail_len < Self::ENCODED_LEN {
6280 payload_buf[0..avail_len].copy_from_slice(__input);
6281 Bytes::new(&payload_buf)
6282 } else {
6283 Bytes::new(__input)
6284 };
6285 let mut __struct = Self::default();
6286 __struct.time_boot_us = buf.get_u64_le();
6287 for v in &mut __struct.q {
6288 let val = buf.get_f32_le();
6289 *v = val;
6290 }
6291 __struct.q_estimated_delay_us = buf.get_u32_le();
6292 __struct.vx = buf.get_f32_le();
6293 __struct.vy = buf.get_f32_le();
6294 __struct.vz = buf.get_f32_le();
6295 __struct.v_estimated_delay_us = buf.get_u32_le();
6296 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6297 let tmp = buf.get_u16_le();
6298 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6299 tmp & EstimatorStatusFlags::all().bits(),
6300 )
6301 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6302 flag_type: "EstimatorStatusFlags",
6303 value: tmp as u32,
6304 })?;
6305 __struct.target_system = buf.get_u8();
6306 __struct.target_component = buf.get_u8();
6307 let tmp = buf.get_u8();
6308 __struct.landed_state =
6309 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6310 enum_type: "MavLandedState",
6311 value: tmp as u32,
6312 })?;
6313 __struct.angular_velocity_z = buf.get_f32_le();
6314 Ok(__struct)
6315 }
6316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6317 let mut __tmp = BytesMut::new(bytes);
6318 #[allow(clippy::absurd_extreme_comparisons)]
6319 #[allow(unused_comparisons)]
6320 if __tmp.remaining() < Self::ENCODED_LEN {
6321 panic!(
6322 "buffer is too small (need {} bytes, but got {})",
6323 Self::ENCODED_LEN,
6324 __tmp.remaining(),
6325 )
6326 }
6327 __tmp.put_u64_le(self.time_boot_us);
6328 for val in &self.q {
6329 __tmp.put_f32_le(*val);
6330 }
6331 __tmp.put_u32_le(self.q_estimated_delay_us);
6332 __tmp.put_f32_le(self.vx);
6333 __tmp.put_f32_le(self.vy);
6334 __tmp.put_f32_le(self.vz);
6335 __tmp.put_u32_le(self.v_estimated_delay_us);
6336 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6337 __tmp.put_u16_le(self.estimator_status.bits());
6338 __tmp.put_u8(self.target_system);
6339 __tmp.put_u8(self.target_component);
6340 __tmp.put_u8(self.landed_state as u8);
6341 __tmp.put_f32_le(self.angular_velocity_z);
6342 if matches!(version, MavlinkVersion::V2) {
6343 let len = __tmp.len();
6344 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6345 } else {
6346 __tmp.len()
6347 }
6348 }
6349}
6350#[doc = "id: 148"]
6351#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6352#[derive(Debug, Clone, PartialEq)]
6353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6355pub struct AUTOPILOT_VERSION_DATA {
6356 #[doc = "Bitmap of capabilities"]
6357 pub capabilities: MavProtocolCapability,
6358 #[doc = "UID if provided by hardware (see uid2)"]
6359 pub uid: u64,
6360 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6361 pub flight_sw_version: u32,
6362 #[doc = "Middleware version number"]
6363 pub middleware_sw_version: u32,
6364 #[doc = "Operating system version number"]
6365 pub os_sw_version: u32,
6366 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6367 pub board_version: u32,
6368 #[doc = "ID of the board vendor"]
6369 pub vendor_id: u16,
6370 #[doc = "ID of the product"]
6371 pub product_id: u16,
6372 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6373 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6374 pub flight_custom_version: [u8; 8],
6375 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6376 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6377 pub middleware_custom_version: [u8; 8],
6378 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6379 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6380 pub os_custom_version: [u8; 8],
6381 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6382 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6383 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6384 pub uid2: [u8; 18],
6385}
6386impl AUTOPILOT_VERSION_DATA {
6387 pub const ENCODED_LEN: usize = 78usize;
6388 pub const DEFAULT: Self = Self {
6389 capabilities: MavProtocolCapability::DEFAULT,
6390 uid: 0_u64,
6391 flight_sw_version: 0_u32,
6392 middleware_sw_version: 0_u32,
6393 os_sw_version: 0_u32,
6394 board_version: 0_u32,
6395 vendor_id: 0_u16,
6396 product_id: 0_u16,
6397 flight_custom_version: [0_u8; 8usize],
6398 middleware_custom_version: [0_u8; 8usize],
6399 os_custom_version: [0_u8; 8usize],
6400 uid2: [0_u8; 18usize],
6401 };
6402 #[cfg(feature = "arbitrary")]
6403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6404 use arbitrary::{Arbitrary, Unstructured};
6405 let mut buf = [0u8; 1024];
6406 rng.fill_bytes(&mut buf);
6407 let mut unstructured = Unstructured::new(&buf);
6408 Self::arbitrary(&mut unstructured).unwrap_or_default()
6409 }
6410}
6411impl Default for AUTOPILOT_VERSION_DATA {
6412 fn default() -> Self {
6413 Self::DEFAULT.clone()
6414 }
6415}
6416impl MessageData for AUTOPILOT_VERSION_DATA {
6417 type Message = MavMessage;
6418 const ID: u32 = 148u32;
6419 const NAME: &'static str = "AUTOPILOT_VERSION";
6420 const EXTRA_CRC: u8 = 178u8;
6421 const ENCODED_LEN: usize = 78usize;
6422 fn deser(
6423 _version: MavlinkVersion,
6424 __input: &[u8],
6425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6426 let avail_len = __input.len();
6427 let mut payload_buf = [0; Self::ENCODED_LEN];
6428 let mut buf = if avail_len < Self::ENCODED_LEN {
6429 payload_buf[0..avail_len].copy_from_slice(__input);
6430 Bytes::new(&payload_buf)
6431 } else {
6432 Bytes::new(__input)
6433 };
6434 let mut __struct = Self::default();
6435 let tmp = buf.get_u64_le();
6436 __struct.capabilities = MavProtocolCapability::from_bits(
6437 tmp & MavProtocolCapability::all().bits(),
6438 )
6439 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6440 flag_type: "MavProtocolCapability",
6441 value: tmp as u32,
6442 })?;
6443 __struct.uid = buf.get_u64_le();
6444 __struct.flight_sw_version = buf.get_u32_le();
6445 __struct.middleware_sw_version = buf.get_u32_le();
6446 __struct.os_sw_version = buf.get_u32_le();
6447 __struct.board_version = buf.get_u32_le();
6448 __struct.vendor_id = buf.get_u16_le();
6449 __struct.product_id = buf.get_u16_le();
6450 for v in &mut __struct.flight_custom_version {
6451 let val = buf.get_u8();
6452 *v = val;
6453 }
6454 for v in &mut __struct.middleware_custom_version {
6455 let val = buf.get_u8();
6456 *v = val;
6457 }
6458 for v in &mut __struct.os_custom_version {
6459 let val = buf.get_u8();
6460 *v = val;
6461 }
6462 for v in &mut __struct.uid2 {
6463 let val = buf.get_u8();
6464 *v = val;
6465 }
6466 Ok(__struct)
6467 }
6468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6469 let mut __tmp = BytesMut::new(bytes);
6470 #[allow(clippy::absurd_extreme_comparisons)]
6471 #[allow(unused_comparisons)]
6472 if __tmp.remaining() < Self::ENCODED_LEN {
6473 panic!(
6474 "buffer is too small (need {} bytes, but got {})",
6475 Self::ENCODED_LEN,
6476 __tmp.remaining(),
6477 )
6478 }
6479 __tmp.put_u64_le(self.capabilities.bits());
6480 __tmp.put_u64_le(self.uid);
6481 __tmp.put_u32_le(self.flight_sw_version);
6482 __tmp.put_u32_le(self.middleware_sw_version);
6483 __tmp.put_u32_le(self.os_sw_version);
6484 __tmp.put_u32_le(self.board_version);
6485 __tmp.put_u16_le(self.vendor_id);
6486 __tmp.put_u16_le(self.product_id);
6487 for val in &self.flight_custom_version {
6488 __tmp.put_u8(*val);
6489 }
6490 for val in &self.middleware_custom_version {
6491 __tmp.put_u8(*val);
6492 }
6493 for val in &self.os_custom_version {
6494 __tmp.put_u8(*val);
6495 }
6496 for val in &self.uid2 {
6497 __tmp.put_u8(*val);
6498 }
6499 if matches!(version, MavlinkVersion::V2) {
6500 let len = __tmp.len();
6501 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6502 } else {
6503 __tmp.len()
6504 }
6505 }
6506}
6507#[doc = "id: 435"]
6508#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6509#[derive(Debug, Clone, PartialEq)]
6510#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6511#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6512pub struct AVAILABLE_MODES_DATA {
6513 #[doc = "A bitfield for use for autopilot-specific flags"]
6514 pub custom_mode: u32,
6515 #[doc = "Mode properties."]
6516 pub properties: MavModeProperty,
6517 #[doc = "The total number of available modes for the current vehicle type."]
6518 pub number_modes: u8,
6519 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6520 pub mode_index: u8,
6521 #[doc = "Standard mode."]
6522 pub standard_mode: MavStandardMode,
6523 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6524 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6525 pub mode_name: [u8; 35],
6526}
6527impl AVAILABLE_MODES_DATA {
6528 pub const ENCODED_LEN: usize = 46usize;
6529 pub const DEFAULT: Self = Self {
6530 custom_mode: 0_u32,
6531 properties: MavModeProperty::DEFAULT,
6532 number_modes: 0_u8,
6533 mode_index: 0_u8,
6534 standard_mode: MavStandardMode::DEFAULT,
6535 mode_name: [0_u8; 35usize],
6536 };
6537 #[cfg(feature = "arbitrary")]
6538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6539 use arbitrary::{Arbitrary, Unstructured};
6540 let mut buf = [0u8; 1024];
6541 rng.fill_bytes(&mut buf);
6542 let mut unstructured = Unstructured::new(&buf);
6543 Self::arbitrary(&mut unstructured).unwrap_or_default()
6544 }
6545}
6546impl Default for AVAILABLE_MODES_DATA {
6547 fn default() -> Self {
6548 Self::DEFAULT.clone()
6549 }
6550}
6551impl MessageData for AVAILABLE_MODES_DATA {
6552 type Message = MavMessage;
6553 const ID: u32 = 435u32;
6554 const NAME: &'static str = "AVAILABLE_MODES";
6555 const EXTRA_CRC: u8 = 134u8;
6556 const ENCODED_LEN: usize = 46usize;
6557 fn deser(
6558 _version: MavlinkVersion,
6559 __input: &[u8],
6560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6561 let avail_len = __input.len();
6562 let mut payload_buf = [0; Self::ENCODED_LEN];
6563 let mut buf = if avail_len < Self::ENCODED_LEN {
6564 payload_buf[0..avail_len].copy_from_slice(__input);
6565 Bytes::new(&payload_buf)
6566 } else {
6567 Bytes::new(__input)
6568 };
6569 let mut __struct = Self::default();
6570 __struct.custom_mode = buf.get_u32_le();
6571 let tmp = buf.get_u32_le();
6572 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6573 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6574 flag_type: "MavModeProperty",
6575 value: tmp as u32,
6576 })?;
6577 __struct.number_modes = buf.get_u8();
6578 __struct.mode_index = buf.get_u8();
6579 let tmp = buf.get_u8();
6580 __struct.standard_mode =
6581 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6582 enum_type: "MavStandardMode",
6583 value: tmp as u32,
6584 })?;
6585 for v in &mut __struct.mode_name {
6586 let val = buf.get_u8();
6587 *v = val;
6588 }
6589 Ok(__struct)
6590 }
6591 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6592 let mut __tmp = BytesMut::new(bytes);
6593 #[allow(clippy::absurd_extreme_comparisons)]
6594 #[allow(unused_comparisons)]
6595 if __tmp.remaining() < Self::ENCODED_LEN {
6596 panic!(
6597 "buffer is too small (need {} bytes, but got {})",
6598 Self::ENCODED_LEN,
6599 __tmp.remaining(),
6600 )
6601 }
6602 __tmp.put_u32_le(self.custom_mode);
6603 __tmp.put_u32_le(self.properties.bits());
6604 __tmp.put_u8(self.number_modes);
6605 __tmp.put_u8(self.mode_index);
6606 __tmp.put_u8(self.standard_mode as u8);
6607 for val in &self.mode_name {
6608 __tmp.put_u8(*val);
6609 }
6610 if matches!(version, MavlinkVersion::V2) {
6611 let len = __tmp.len();
6612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6613 } else {
6614 __tmp.len()
6615 }
6616 }
6617}
6618#[doc = "id: 437"]
6619#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6620#[derive(Debug, Clone, PartialEq)]
6621#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6623pub struct AVAILABLE_MODES_MONITOR_DATA {
6624 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6625 pub seq: u8,
6626}
6627impl AVAILABLE_MODES_MONITOR_DATA {
6628 pub const ENCODED_LEN: usize = 1usize;
6629 pub const DEFAULT: Self = Self { seq: 0_u8 };
6630 #[cfg(feature = "arbitrary")]
6631 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6632 use arbitrary::{Arbitrary, Unstructured};
6633 let mut buf = [0u8; 1024];
6634 rng.fill_bytes(&mut buf);
6635 let mut unstructured = Unstructured::new(&buf);
6636 Self::arbitrary(&mut unstructured).unwrap_or_default()
6637 }
6638}
6639impl Default for AVAILABLE_MODES_MONITOR_DATA {
6640 fn default() -> Self {
6641 Self::DEFAULT.clone()
6642 }
6643}
6644impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6645 type Message = MavMessage;
6646 const ID: u32 = 437u32;
6647 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6648 const EXTRA_CRC: u8 = 30u8;
6649 const ENCODED_LEN: usize = 1usize;
6650 fn deser(
6651 _version: MavlinkVersion,
6652 __input: &[u8],
6653 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6654 let avail_len = __input.len();
6655 let mut payload_buf = [0; Self::ENCODED_LEN];
6656 let mut buf = if avail_len < Self::ENCODED_LEN {
6657 payload_buf[0..avail_len].copy_from_slice(__input);
6658 Bytes::new(&payload_buf)
6659 } else {
6660 Bytes::new(__input)
6661 };
6662 let mut __struct = Self::default();
6663 __struct.seq = buf.get_u8();
6664 Ok(__struct)
6665 }
6666 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6667 let mut __tmp = BytesMut::new(bytes);
6668 #[allow(clippy::absurd_extreme_comparisons)]
6669 #[allow(unused_comparisons)]
6670 if __tmp.remaining() < Self::ENCODED_LEN {
6671 panic!(
6672 "buffer is too small (need {} bytes, but got {})",
6673 Self::ENCODED_LEN,
6674 __tmp.remaining(),
6675 )
6676 }
6677 __tmp.put_u8(self.seq);
6678 if matches!(version, MavlinkVersion::V2) {
6679 let len = __tmp.len();
6680 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6681 } else {
6682 __tmp.len()
6683 }
6684 }
6685}
6686#[doc = "id: 372"]
6687#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6688#[derive(Debug, Clone, PartialEq)]
6689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6691pub struct BATTERY_INFO_DATA {
6692 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6693 pub discharge_minimum_voltage: f32,
6694 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6695 pub charging_minimum_voltage: f32,
6696 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6697 pub resting_minimum_voltage: f32,
6698 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6699 pub charging_maximum_voltage: f32,
6700 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6701 pub charging_maximum_current: f32,
6702 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6703 pub nominal_voltage: f32,
6704 #[doc = "Maximum pack discharge current. 0: field not provided."]
6705 pub discharge_maximum_current: f32,
6706 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6707 pub discharge_maximum_burst_current: f32,
6708 #[doc = "Fully charged design capacity. 0: field not provided."]
6709 pub design_capacity: f32,
6710 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6711 pub full_charge_capacity: f32,
6712 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6713 pub cycle_count: u16,
6714 #[doc = "Battery weight. 0: field not provided."]
6715 pub weight: u16,
6716 #[doc = "Battery ID"]
6717 pub id: u8,
6718 #[doc = "Function of the battery."]
6719 pub battery_function: MavBatteryFunction,
6720 #[doc = "Type (chemistry) of the battery."]
6721 pub mavtype: MavBatteryType,
6722 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6723 pub state_of_health: u8,
6724 #[doc = "Number of battery cells in series. 0: field not provided."]
6725 pub cells_in_series: u8,
6726 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6727 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6728 pub manufacture_date: [u8; 9],
6729 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6730 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6731 pub serial_number: [u8; 32],
6732 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6733 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6734 pub name: [u8; 50],
6735}
6736impl BATTERY_INFO_DATA {
6737 pub const ENCODED_LEN: usize = 140usize;
6738 pub const DEFAULT: Self = Self {
6739 discharge_minimum_voltage: 0.0_f32,
6740 charging_minimum_voltage: 0.0_f32,
6741 resting_minimum_voltage: 0.0_f32,
6742 charging_maximum_voltage: 0.0_f32,
6743 charging_maximum_current: 0.0_f32,
6744 nominal_voltage: 0.0_f32,
6745 discharge_maximum_current: 0.0_f32,
6746 discharge_maximum_burst_current: 0.0_f32,
6747 design_capacity: 0.0_f32,
6748 full_charge_capacity: 0.0_f32,
6749 cycle_count: 0_u16,
6750 weight: 0_u16,
6751 id: 0_u8,
6752 battery_function: MavBatteryFunction::DEFAULT,
6753 mavtype: MavBatteryType::DEFAULT,
6754 state_of_health: 0_u8,
6755 cells_in_series: 0_u8,
6756 manufacture_date: [0_u8; 9usize],
6757 serial_number: [0_u8; 32usize],
6758 name: [0_u8; 50usize],
6759 };
6760 #[cfg(feature = "arbitrary")]
6761 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6762 use arbitrary::{Arbitrary, Unstructured};
6763 let mut buf = [0u8; 1024];
6764 rng.fill_bytes(&mut buf);
6765 let mut unstructured = Unstructured::new(&buf);
6766 Self::arbitrary(&mut unstructured).unwrap_or_default()
6767 }
6768}
6769impl Default for BATTERY_INFO_DATA {
6770 fn default() -> Self {
6771 Self::DEFAULT.clone()
6772 }
6773}
6774impl MessageData for BATTERY_INFO_DATA {
6775 type Message = MavMessage;
6776 const ID: u32 = 372u32;
6777 const NAME: &'static str = "BATTERY_INFO";
6778 const EXTRA_CRC: u8 = 26u8;
6779 const ENCODED_LEN: usize = 140usize;
6780 fn deser(
6781 _version: MavlinkVersion,
6782 __input: &[u8],
6783 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6784 let avail_len = __input.len();
6785 let mut payload_buf = [0; Self::ENCODED_LEN];
6786 let mut buf = if avail_len < Self::ENCODED_LEN {
6787 payload_buf[0..avail_len].copy_from_slice(__input);
6788 Bytes::new(&payload_buf)
6789 } else {
6790 Bytes::new(__input)
6791 };
6792 let mut __struct = Self::default();
6793 __struct.discharge_minimum_voltage = buf.get_f32_le();
6794 __struct.charging_minimum_voltage = buf.get_f32_le();
6795 __struct.resting_minimum_voltage = buf.get_f32_le();
6796 __struct.charging_maximum_voltage = buf.get_f32_le();
6797 __struct.charging_maximum_current = buf.get_f32_le();
6798 __struct.nominal_voltage = buf.get_f32_le();
6799 __struct.discharge_maximum_current = buf.get_f32_le();
6800 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6801 __struct.design_capacity = buf.get_f32_le();
6802 __struct.full_charge_capacity = buf.get_f32_le();
6803 __struct.cycle_count = buf.get_u16_le();
6804 __struct.weight = buf.get_u16_le();
6805 __struct.id = buf.get_u8();
6806 let tmp = buf.get_u8();
6807 __struct.battery_function =
6808 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6809 enum_type: "MavBatteryFunction",
6810 value: tmp as u32,
6811 })?;
6812 let tmp = buf.get_u8();
6813 __struct.mavtype =
6814 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6815 enum_type: "MavBatteryType",
6816 value: tmp as u32,
6817 })?;
6818 __struct.state_of_health = buf.get_u8();
6819 __struct.cells_in_series = buf.get_u8();
6820 for v in &mut __struct.manufacture_date {
6821 let val = buf.get_u8();
6822 *v = val;
6823 }
6824 for v in &mut __struct.serial_number {
6825 let val = buf.get_u8();
6826 *v = val;
6827 }
6828 for v in &mut __struct.name {
6829 let val = buf.get_u8();
6830 *v = val;
6831 }
6832 Ok(__struct)
6833 }
6834 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6835 let mut __tmp = BytesMut::new(bytes);
6836 #[allow(clippy::absurd_extreme_comparisons)]
6837 #[allow(unused_comparisons)]
6838 if __tmp.remaining() < Self::ENCODED_LEN {
6839 panic!(
6840 "buffer is too small (need {} bytes, but got {})",
6841 Self::ENCODED_LEN,
6842 __tmp.remaining(),
6843 )
6844 }
6845 __tmp.put_f32_le(self.discharge_minimum_voltage);
6846 __tmp.put_f32_le(self.charging_minimum_voltage);
6847 __tmp.put_f32_le(self.resting_minimum_voltage);
6848 __tmp.put_f32_le(self.charging_maximum_voltage);
6849 __tmp.put_f32_le(self.charging_maximum_current);
6850 __tmp.put_f32_le(self.nominal_voltage);
6851 __tmp.put_f32_le(self.discharge_maximum_current);
6852 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6853 __tmp.put_f32_le(self.design_capacity);
6854 __tmp.put_f32_le(self.full_charge_capacity);
6855 __tmp.put_u16_le(self.cycle_count);
6856 __tmp.put_u16_le(self.weight);
6857 __tmp.put_u8(self.id);
6858 __tmp.put_u8(self.battery_function as u8);
6859 __tmp.put_u8(self.mavtype as u8);
6860 __tmp.put_u8(self.state_of_health);
6861 __tmp.put_u8(self.cells_in_series);
6862 for val in &self.manufacture_date {
6863 __tmp.put_u8(*val);
6864 }
6865 for val in &self.serial_number {
6866 __tmp.put_u8(*val);
6867 }
6868 for val in &self.name {
6869 __tmp.put_u8(*val);
6870 }
6871 if matches!(version, MavlinkVersion::V2) {
6872 let len = __tmp.len();
6873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6874 } else {
6875 __tmp.len()
6876 }
6877 }
6878}
6879#[doc = "id: 147"]
6880#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6881#[derive(Debug, Clone, PartialEq)]
6882#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6883#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6884pub struct BATTERY_STATUS_DATA {
6885 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6886 pub current_consumed: i32,
6887 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6888 pub energy_consumed: i32,
6889 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6890 pub temperature: i16,
6891 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6892 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6893 pub voltages: [u16; 10],
6894 #[doc = "Battery current, -1: autopilot does not measure the current"]
6895 pub current_battery: i16,
6896 #[doc = "Battery ID"]
6897 pub id: u8,
6898 #[doc = "Function of the battery"]
6899 pub battery_function: MavBatteryFunction,
6900 #[doc = "Type (chemistry) of the battery"]
6901 pub mavtype: MavBatteryType,
6902 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6903 pub battery_remaining: i8,
6904 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6905 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6906 pub time_remaining: i32,
6907 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6908 #[cfg_attr(feature = "serde", serde(default))]
6909 pub charge_state: MavBatteryChargeState,
6910 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6911 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6912 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6913 pub voltages_ext: [u16; 4],
6914 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6915 #[cfg_attr(feature = "serde", serde(default))]
6916 pub mode: MavBatteryMode,
6917 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6918 #[cfg_attr(feature = "serde", serde(default))]
6919 pub fault_bitmask: MavBatteryFault,
6920}
6921impl BATTERY_STATUS_DATA {
6922 pub const ENCODED_LEN: usize = 54usize;
6923 pub const DEFAULT: Self = Self {
6924 current_consumed: 0_i32,
6925 energy_consumed: 0_i32,
6926 temperature: 0_i16,
6927 voltages: [0_u16; 10usize],
6928 current_battery: 0_i16,
6929 id: 0_u8,
6930 battery_function: MavBatteryFunction::DEFAULT,
6931 mavtype: MavBatteryType::DEFAULT,
6932 battery_remaining: 0_i8,
6933 time_remaining: 0_i32,
6934 charge_state: MavBatteryChargeState::DEFAULT,
6935 voltages_ext: [0_u16; 4usize],
6936 mode: MavBatteryMode::DEFAULT,
6937 fault_bitmask: MavBatteryFault::DEFAULT,
6938 };
6939 #[cfg(feature = "arbitrary")]
6940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6941 use arbitrary::{Arbitrary, Unstructured};
6942 let mut buf = [0u8; 1024];
6943 rng.fill_bytes(&mut buf);
6944 let mut unstructured = Unstructured::new(&buf);
6945 Self::arbitrary(&mut unstructured).unwrap_or_default()
6946 }
6947}
6948impl Default for BATTERY_STATUS_DATA {
6949 fn default() -> Self {
6950 Self::DEFAULT.clone()
6951 }
6952}
6953impl MessageData for BATTERY_STATUS_DATA {
6954 type Message = MavMessage;
6955 const ID: u32 = 147u32;
6956 const NAME: &'static str = "BATTERY_STATUS";
6957 const EXTRA_CRC: u8 = 154u8;
6958 const ENCODED_LEN: usize = 54usize;
6959 fn deser(
6960 _version: MavlinkVersion,
6961 __input: &[u8],
6962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6963 let avail_len = __input.len();
6964 let mut payload_buf = [0; Self::ENCODED_LEN];
6965 let mut buf = if avail_len < Self::ENCODED_LEN {
6966 payload_buf[0..avail_len].copy_from_slice(__input);
6967 Bytes::new(&payload_buf)
6968 } else {
6969 Bytes::new(__input)
6970 };
6971 let mut __struct = Self::default();
6972 __struct.current_consumed = buf.get_i32_le();
6973 __struct.energy_consumed = buf.get_i32_le();
6974 __struct.temperature = buf.get_i16_le();
6975 for v in &mut __struct.voltages {
6976 let val = buf.get_u16_le();
6977 *v = val;
6978 }
6979 __struct.current_battery = buf.get_i16_le();
6980 __struct.id = buf.get_u8();
6981 let tmp = buf.get_u8();
6982 __struct.battery_function =
6983 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6984 enum_type: "MavBatteryFunction",
6985 value: tmp as u32,
6986 })?;
6987 let tmp = buf.get_u8();
6988 __struct.mavtype =
6989 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6990 enum_type: "MavBatteryType",
6991 value: tmp as u32,
6992 })?;
6993 __struct.battery_remaining = buf.get_i8();
6994 __struct.time_remaining = buf.get_i32_le();
6995 let tmp = buf.get_u8();
6996 __struct.charge_state =
6997 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6998 enum_type: "MavBatteryChargeState",
6999 value: tmp as u32,
7000 })?;
7001 for v in &mut __struct.voltages_ext {
7002 let val = buf.get_u16_le();
7003 *v = val;
7004 }
7005 let tmp = buf.get_u8();
7006 __struct.mode =
7007 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7008 enum_type: "MavBatteryMode",
7009 value: tmp as u32,
7010 })?;
7011 let tmp = buf.get_u32_le();
7012 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
7013 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7014 flag_type: "MavBatteryFault",
7015 value: tmp as u32,
7016 })?;
7017 Ok(__struct)
7018 }
7019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7020 let mut __tmp = BytesMut::new(bytes);
7021 #[allow(clippy::absurd_extreme_comparisons)]
7022 #[allow(unused_comparisons)]
7023 if __tmp.remaining() < Self::ENCODED_LEN {
7024 panic!(
7025 "buffer is too small (need {} bytes, but got {})",
7026 Self::ENCODED_LEN,
7027 __tmp.remaining(),
7028 )
7029 }
7030 __tmp.put_i32_le(self.current_consumed);
7031 __tmp.put_i32_le(self.energy_consumed);
7032 __tmp.put_i16_le(self.temperature);
7033 for val in &self.voltages {
7034 __tmp.put_u16_le(*val);
7035 }
7036 __tmp.put_i16_le(self.current_battery);
7037 __tmp.put_u8(self.id);
7038 __tmp.put_u8(self.battery_function as u8);
7039 __tmp.put_u8(self.mavtype as u8);
7040 __tmp.put_i8(self.battery_remaining);
7041 __tmp.put_i32_le(self.time_remaining);
7042 __tmp.put_u8(self.charge_state as u8);
7043 for val in &self.voltages_ext {
7044 __tmp.put_u16_le(*val);
7045 }
7046 __tmp.put_u8(self.mode as u8);
7047 __tmp.put_u32_le(self.fault_bitmask.bits());
7048 if matches!(version, MavlinkVersion::V2) {
7049 let len = __tmp.len();
7050 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7051 } else {
7052 __tmp.len()
7053 }
7054 }
7055}
7056#[doc = "id: 257"]
7057#[doc = "Report button state change."]
7058#[derive(Debug, Clone, PartialEq)]
7059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7061pub struct BUTTON_CHANGE_DATA {
7062 #[doc = "Timestamp (time since system boot)."]
7063 pub time_boot_ms: u32,
7064 #[doc = "Time of last change of button state."]
7065 pub last_change_ms: u32,
7066 #[doc = "Bitmap for state of buttons."]
7067 pub state: u8,
7068}
7069impl BUTTON_CHANGE_DATA {
7070 pub const ENCODED_LEN: usize = 9usize;
7071 pub const DEFAULT: Self = Self {
7072 time_boot_ms: 0_u32,
7073 last_change_ms: 0_u32,
7074 state: 0_u8,
7075 };
7076 #[cfg(feature = "arbitrary")]
7077 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7078 use arbitrary::{Arbitrary, Unstructured};
7079 let mut buf = [0u8; 1024];
7080 rng.fill_bytes(&mut buf);
7081 let mut unstructured = Unstructured::new(&buf);
7082 Self::arbitrary(&mut unstructured).unwrap_or_default()
7083 }
7084}
7085impl Default for BUTTON_CHANGE_DATA {
7086 fn default() -> Self {
7087 Self::DEFAULT.clone()
7088 }
7089}
7090impl MessageData for BUTTON_CHANGE_DATA {
7091 type Message = MavMessage;
7092 const ID: u32 = 257u32;
7093 const NAME: &'static str = "BUTTON_CHANGE";
7094 const EXTRA_CRC: u8 = 131u8;
7095 const ENCODED_LEN: usize = 9usize;
7096 fn deser(
7097 _version: MavlinkVersion,
7098 __input: &[u8],
7099 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7100 let avail_len = __input.len();
7101 let mut payload_buf = [0; Self::ENCODED_LEN];
7102 let mut buf = if avail_len < Self::ENCODED_LEN {
7103 payload_buf[0..avail_len].copy_from_slice(__input);
7104 Bytes::new(&payload_buf)
7105 } else {
7106 Bytes::new(__input)
7107 };
7108 let mut __struct = Self::default();
7109 __struct.time_boot_ms = buf.get_u32_le();
7110 __struct.last_change_ms = buf.get_u32_le();
7111 __struct.state = buf.get_u8();
7112 Ok(__struct)
7113 }
7114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7115 let mut __tmp = BytesMut::new(bytes);
7116 #[allow(clippy::absurd_extreme_comparisons)]
7117 #[allow(unused_comparisons)]
7118 if __tmp.remaining() < Self::ENCODED_LEN {
7119 panic!(
7120 "buffer is too small (need {} bytes, but got {})",
7121 Self::ENCODED_LEN,
7122 __tmp.remaining(),
7123 )
7124 }
7125 __tmp.put_u32_le(self.time_boot_ms);
7126 __tmp.put_u32_le(self.last_change_ms);
7127 __tmp.put_u8(self.state);
7128 if matches!(version, MavlinkVersion::V2) {
7129 let len = __tmp.len();
7130 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7131 } else {
7132 __tmp.len()
7133 }
7134 }
7135}
7136#[doc = "id: 262"]
7137#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7138#[derive(Debug, Clone, PartialEq)]
7139#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7140#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7141pub struct CAMERA_CAPTURE_STATUS_DATA {
7142 #[doc = "Timestamp (time since system boot)."]
7143 pub time_boot_ms: u32,
7144 #[doc = "Image capture interval"]
7145 pub image_interval: f32,
7146 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7147 pub recording_time_ms: u32,
7148 #[doc = "Available storage capacity."]
7149 pub available_capacity: f32,
7150 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7151 pub image_status: u8,
7152 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7153 pub video_status: u8,
7154 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7155 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7156 pub image_count: i32,
7157 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7158 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7159 pub camera_device_id: u8,
7160}
7161impl CAMERA_CAPTURE_STATUS_DATA {
7162 pub const ENCODED_LEN: usize = 23usize;
7163 pub const DEFAULT: Self = Self {
7164 time_boot_ms: 0_u32,
7165 image_interval: 0.0_f32,
7166 recording_time_ms: 0_u32,
7167 available_capacity: 0.0_f32,
7168 image_status: 0_u8,
7169 video_status: 0_u8,
7170 image_count: 0_i32,
7171 camera_device_id: 0_u8,
7172 };
7173 #[cfg(feature = "arbitrary")]
7174 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7175 use arbitrary::{Arbitrary, Unstructured};
7176 let mut buf = [0u8; 1024];
7177 rng.fill_bytes(&mut buf);
7178 let mut unstructured = Unstructured::new(&buf);
7179 Self::arbitrary(&mut unstructured).unwrap_or_default()
7180 }
7181}
7182impl Default for CAMERA_CAPTURE_STATUS_DATA {
7183 fn default() -> Self {
7184 Self::DEFAULT.clone()
7185 }
7186}
7187impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7188 type Message = MavMessage;
7189 const ID: u32 = 262u32;
7190 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7191 const EXTRA_CRC: u8 = 12u8;
7192 const ENCODED_LEN: usize = 23usize;
7193 fn deser(
7194 _version: MavlinkVersion,
7195 __input: &[u8],
7196 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7197 let avail_len = __input.len();
7198 let mut payload_buf = [0; Self::ENCODED_LEN];
7199 let mut buf = if avail_len < Self::ENCODED_LEN {
7200 payload_buf[0..avail_len].copy_from_slice(__input);
7201 Bytes::new(&payload_buf)
7202 } else {
7203 Bytes::new(__input)
7204 };
7205 let mut __struct = Self::default();
7206 __struct.time_boot_ms = buf.get_u32_le();
7207 __struct.image_interval = buf.get_f32_le();
7208 __struct.recording_time_ms = buf.get_u32_le();
7209 __struct.available_capacity = buf.get_f32_le();
7210 __struct.image_status = buf.get_u8();
7211 __struct.video_status = buf.get_u8();
7212 __struct.image_count = buf.get_i32_le();
7213 __struct.camera_device_id = buf.get_u8();
7214 Ok(__struct)
7215 }
7216 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7217 let mut __tmp = BytesMut::new(bytes);
7218 #[allow(clippy::absurd_extreme_comparisons)]
7219 #[allow(unused_comparisons)]
7220 if __tmp.remaining() < Self::ENCODED_LEN {
7221 panic!(
7222 "buffer is too small (need {} bytes, but got {})",
7223 Self::ENCODED_LEN,
7224 __tmp.remaining(),
7225 )
7226 }
7227 __tmp.put_u32_le(self.time_boot_ms);
7228 __tmp.put_f32_le(self.image_interval);
7229 __tmp.put_u32_le(self.recording_time_ms);
7230 __tmp.put_f32_le(self.available_capacity);
7231 __tmp.put_u8(self.image_status);
7232 __tmp.put_u8(self.video_status);
7233 __tmp.put_i32_le(self.image_count);
7234 __tmp.put_u8(self.camera_device_id);
7235 if matches!(version, MavlinkVersion::V2) {
7236 let len = __tmp.len();
7237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7238 } else {
7239 __tmp.len()
7240 }
7241 }
7242}
7243#[doc = "id: 271"]
7244#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7245#[derive(Debug, Clone, PartialEq)]
7246#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7247#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7248pub struct CAMERA_FOV_STATUS_DATA {
7249 #[doc = "Timestamp (time since system boot)."]
7250 pub time_boot_ms: u32,
7251 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7252 pub lat_camera: i32,
7253 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7254 pub lon_camera: i32,
7255 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7256 pub alt_camera: i32,
7257 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7258 pub lat_image: i32,
7259 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7260 pub lon_image: i32,
7261 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7262 pub alt_image: i32,
7263 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7264 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7265 pub q: [f32; 4],
7266 #[doc = "Horizontal field of view (NaN if unknown)."]
7267 pub hfov: f32,
7268 #[doc = "Vertical field of view (NaN if unknown)."]
7269 pub vfov: f32,
7270 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7271 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7272 pub camera_device_id: u8,
7273}
7274impl CAMERA_FOV_STATUS_DATA {
7275 pub const ENCODED_LEN: usize = 53usize;
7276 pub const DEFAULT: Self = Self {
7277 time_boot_ms: 0_u32,
7278 lat_camera: 0_i32,
7279 lon_camera: 0_i32,
7280 alt_camera: 0_i32,
7281 lat_image: 0_i32,
7282 lon_image: 0_i32,
7283 alt_image: 0_i32,
7284 q: [0.0_f32; 4usize],
7285 hfov: 0.0_f32,
7286 vfov: 0.0_f32,
7287 camera_device_id: 0_u8,
7288 };
7289 #[cfg(feature = "arbitrary")]
7290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7291 use arbitrary::{Arbitrary, Unstructured};
7292 let mut buf = [0u8; 1024];
7293 rng.fill_bytes(&mut buf);
7294 let mut unstructured = Unstructured::new(&buf);
7295 Self::arbitrary(&mut unstructured).unwrap_or_default()
7296 }
7297}
7298impl Default for CAMERA_FOV_STATUS_DATA {
7299 fn default() -> Self {
7300 Self::DEFAULT.clone()
7301 }
7302}
7303impl MessageData for CAMERA_FOV_STATUS_DATA {
7304 type Message = MavMessage;
7305 const ID: u32 = 271u32;
7306 const NAME: &'static str = "CAMERA_FOV_STATUS";
7307 const EXTRA_CRC: u8 = 22u8;
7308 const ENCODED_LEN: usize = 53usize;
7309 fn deser(
7310 _version: MavlinkVersion,
7311 __input: &[u8],
7312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7313 let avail_len = __input.len();
7314 let mut payload_buf = [0; Self::ENCODED_LEN];
7315 let mut buf = if avail_len < Self::ENCODED_LEN {
7316 payload_buf[0..avail_len].copy_from_slice(__input);
7317 Bytes::new(&payload_buf)
7318 } else {
7319 Bytes::new(__input)
7320 };
7321 let mut __struct = Self::default();
7322 __struct.time_boot_ms = buf.get_u32_le();
7323 __struct.lat_camera = buf.get_i32_le();
7324 __struct.lon_camera = buf.get_i32_le();
7325 __struct.alt_camera = buf.get_i32_le();
7326 __struct.lat_image = buf.get_i32_le();
7327 __struct.lon_image = buf.get_i32_le();
7328 __struct.alt_image = buf.get_i32_le();
7329 for v in &mut __struct.q {
7330 let val = buf.get_f32_le();
7331 *v = val;
7332 }
7333 __struct.hfov = buf.get_f32_le();
7334 __struct.vfov = buf.get_f32_le();
7335 __struct.camera_device_id = buf.get_u8();
7336 Ok(__struct)
7337 }
7338 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7339 let mut __tmp = BytesMut::new(bytes);
7340 #[allow(clippy::absurd_extreme_comparisons)]
7341 #[allow(unused_comparisons)]
7342 if __tmp.remaining() < Self::ENCODED_LEN {
7343 panic!(
7344 "buffer is too small (need {} bytes, but got {})",
7345 Self::ENCODED_LEN,
7346 __tmp.remaining(),
7347 )
7348 }
7349 __tmp.put_u32_le(self.time_boot_ms);
7350 __tmp.put_i32_le(self.lat_camera);
7351 __tmp.put_i32_le(self.lon_camera);
7352 __tmp.put_i32_le(self.alt_camera);
7353 __tmp.put_i32_le(self.lat_image);
7354 __tmp.put_i32_le(self.lon_image);
7355 __tmp.put_i32_le(self.alt_image);
7356 for val in &self.q {
7357 __tmp.put_f32_le(*val);
7358 }
7359 __tmp.put_f32_le(self.hfov);
7360 __tmp.put_f32_le(self.vfov);
7361 __tmp.put_u8(self.camera_device_id);
7362 if matches!(version, MavlinkVersion::V2) {
7363 let len = __tmp.len();
7364 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7365 } else {
7366 __tmp.len()
7367 }
7368 }
7369}
7370#[doc = "id: 263"]
7371#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7372#[derive(Debug, Clone, PartialEq)]
7373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7375pub struct CAMERA_IMAGE_CAPTURED_DATA {
7376 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7377 pub time_utc: u64,
7378 #[doc = "Timestamp (time since system boot)."]
7379 pub time_boot_ms: u32,
7380 #[doc = "Latitude where image was taken"]
7381 pub lat: i32,
7382 #[doc = "Longitude where capture was taken"]
7383 pub lon: i32,
7384 #[doc = "Altitude (MSL) where image was taken"]
7385 pub alt: i32,
7386 #[doc = "Altitude above ground"]
7387 pub relative_alt: i32,
7388 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7389 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7390 pub q: [f32; 4],
7391 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7392 pub image_index: i32,
7393 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7394 pub camera_id: u8,
7395 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7396 pub capture_result: i8,
7397 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7398 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7399 pub file_url: [u8; 205],
7400}
7401impl CAMERA_IMAGE_CAPTURED_DATA {
7402 pub const ENCODED_LEN: usize = 255usize;
7403 pub const DEFAULT: Self = Self {
7404 time_utc: 0_u64,
7405 time_boot_ms: 0_u32,
7406 lat: 0_i32,
7407 lon: 0_i32,
7408 alt: 0_i32,
7409 relative_alt: 0_i32,
7410 q: [0.0_f32; 4usize],
7411 image_index: 0_i32,
7412 camera_id: 0_u8,
7413 capture_result: 0_i8,
7414 file_url: [0_u8; 205usize],
7415 };
7416 #[cfg(feature = "arbitrary")]
7417 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7418 use arbitrary::{Arbitrary, Unstructured};
7419 let mut buf = [0u8; 1024];
7420 rng.fill_bytes(&mut buf);
7421 let mut unstructured = Unstructured::new(&buf);
7422 Self::arbitrary(&mut unstructured).unwrap_or_default()
7423 }
7424}
7425impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7426 fn default() -> Self {
7427 Self::DEFAULT.clone()
7428 }
7429}
7430impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7431 type Message = MavMessage;
7432 const ID: u32 = 263u32;
7433 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7434 const EXTRA_CRC: u8 = 133u8;
7435 const ENCODED_LEN: usize = 255usize;
7436 fn deser(
7437 _version: MavlinkVersion,
7438 __input: &[u8],
7439 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7440 let avail_len = __input.len();
7441 let mut payload_buf = [0; Self::ENCODED_LEN];
7442 let mut buf = if avail_len < Self::ENCODED_LEN {
7443 payload_buf[0..avail_len].copy_from_slice(__input);
7444 Bytes::new(&payload_buf)
7445 } else {
7446 Bytes::new(__input)
7447 };
7448 let mut __struct = Self::default();
7449 __struct.time_utc = buf.get_u64_le();
7450 __struct.time_boot_ms = buf.get_u32_le();
7451 __struct.lat = buf.get_i32_le();
7452 __struct.lon = buf.get_i32_le();
7453 __struct.alt = buf.get_i32_le();
7454 __struct.relative_alt = buf.get_i32_le();
7455 for v in &mut __struct.q {
7456 let val = buf.get_f32_le();
7457 *v = val;
7458 }
7459 __struct.image_index = buf.get_i32_le();
7460 __struct.camera_id = buf.get_u8();
7461 __struct.capture_result = buf.get_i8();
7462 for v in &mut __struct.file_url {
7463 let val = buf.get_u8();
7464 *v = val;
7465 }
7466 Ok(__struct)
7467 }
7468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7469 let mut __tmp = BytesMut::new(bytes);
7470 #[allow(clippy::absurd_extreme_comparisons)]
7471 #[allow(unused_comparisons)]
7472 if __tmp.remaining() < Self::ENCODED_LEN {
7473 panic!(
7474 "buffer is too small (need {} bytes, but got {})",
7475 Self::ENCODED_LEN,
7476 __tmp.remaining(),
7477 )
7478 }
7479 __tmp.put_u64_le(self.time_utc);
7480 __tmp.put_u32_le(self.time_boot_ms);
7481 __tmp.put_i32_le(self.lat);
7482 __tmp.put_i32_le(self.lon);
7483 __tmp.put_i32_le(self.alt);
7484 __tmp.put_i32_le(self.relative_alt);
7485 for val in &self.q {
7486 __tmp.put_f32_le(*val);
7487 }
7488 __tmp.put_i32_le(self.image_index);
7489 __tmp.put_u8(self.camera_id);
7490 __tmp.put_i8(self.capture_result);
7491 for val in &self.file_url {
7492 __tmp.put_u8(*val);
7493 }
7494 if matches!(version, MavlinkVersion::V2) {
7495 let len = __tmp.len();
7496 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7497 } else {
7498 __tmp.len()
7499 }
7500 }
7501}
7502#[doc = "id: 259"]
7503#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7504#[derive(Debug, Clone, PartialEq)]
7505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7507pub struct CAMERA_INFORMATION_DATA {
7508 #[doc = "Timestamp (time since system boot)."]
7509 pub time_boot_ms: u32,
7510 #[doc = "0xff). Use 0 if not known."]
7511 pub firmware_version: u32,
7512 #[doc = "Focal length. Use NaN if not known."]
7513 pub focal_length: f32,
7514 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7515 pub sensor_size_h: f32,
7516 #[doc = "Image sensor size vertical. Use NaN if not known."]
7517 pub sensor_size_v: f32,
7518 #[doc = "Bitmap of camera capability flags."]
7519 pub flags: CameraCapFlags,
7520 #[doc = "Horizontal image resolution. Use 0 if not known."]
7521 pub resolution_h: u16,
7522 #[doc = "Vertical image resolution. Use 0 if not known."]
7523 pub resolution_v: u16,
7524 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7525 pub cam_definition_version: u16,
7526 #[doc = "Name of the camera vendor"]
7527 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7528 pub vendor_name: [u8; 32],
7529 #[doc = "Name of the camera model"]
7530 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7531 pub model_name: [u8; 32],
7532 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7533 pub lens_id: u8,
7534 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7535 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7536 pub cam_definition_uri: [u8; 140],
7537 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7538 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7539 pub gimbal_device_id: u8,
7540 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7541 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7542 pub camera_device_id: u8,
7543}
7544impl CAMERA_INFORMATION_DATA {
7545 pub const ENCODED_LEN: usize = 237usize;
7546 pub const DEFAULT: Self = Self {
7547 time_boot_ms: 0_u32,
7548 firmware_version: 0_u32,
7549 focal_length: 0.0_f32,
7550 sensor_size_h: 0.0_f32,
7551 sensor_size_v: 0.0_f32,
7552 flags: CameraCapFlags::DEFAULT,
7553 resolution_h: 0_u16,
7554 resolution_v: 0_u16,
7555 cam_definition_version: 0_u16,
7556 vendor_name: [0_u8; 32usize],
7557 model_name: [0_u8; 32usize],
7558 lens_id: 0_u8,
7559 cam_definition_uri: [0_u8; 140usize],
7560 gimbal_device_id: 0_u8,
7561 camera_device_id: 0_u8,
7562 };
7563 #[cfg(feature = "arbitrary")]
7564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7565 use arbitrary::{Arbitrary, Unstructured};
7566 let mut buf = [0u8; 1024];
7567 rng.fill_bytes(&mut buf);
7568 let mut unstructured = Unstructured::new(&buf);
7569 Self::arbitrary(&mut unstructured).unwrap_or_default()
7570 }
7571}
7572impl Default for CAMERA_INFORMATION_DATA {
7573 fn default() -> Self {
7574 Self::DEFAULT.clone()
7575 }
7576}
7577impl MessageData for CAMERA_INFORMATION_DATA {
7578 type Message = MavMessage;
7579 const ID: u32 = 259u32;
7580 const NAME: &'static str = "CAMERA_INFORMATION";
7581 const EXTRA_CRC: u8 = 92u8;
7582 const ENCODED_LEN: usize = 237usize;
7583 fn deser(
7584 _version: MavlinkVersion,
7585 __input: &[u8],
7586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7587 let avail_len = __input.len();
7588 let mut payload_buf = [0; Self::ENCODED_LEN];
7589 let mut buf = if avail_len < Self::ENCODED_LEN {
7590 payload_buf[0..avail_len].copy_from_slice(__input);
7591 Bytes::new(&payload_buf)
7592 } else {
7593 Bytes::new(__input)
7594 };
7595 let mut __struct = Self::default();
7596 __struct.time_boot_ms = buf.get_u32_le();
7597 __struct.firmware_version = buf.get_u32_le();
7598 __struct.focal_length = buf.get_f32_le();
7599 __struct.sensor_size_h = buf.get_f32_le();
7600 __struct.sensor_size_v = buf.get_f32_le();
7601 let tmp = buf.get_u32_le();
7602 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7603 ::mavlink_core::error::ParserError::InvalidFlag {
7604 flag_type: "CameraCapFlags",
7605 value: tmp as u32,
7606 },
7607 )?;
7608 __struct.resolution_h = buf.get_u16_le();
7609 __struct.resolution_v = buf.get_u16_le();
7610 __struct.cam_definition_version = buf.get_u16_le();
7611 for v in &mut __struct.vendor_name {
7612 let val = buf.get_u8();
7613 *v = val;
7614 }
7615 for v in &mut __struct.model_name {
7616 let val = buf.get_u8();
7617 *v = val;
7618 }
7619 __struct.lens_id = buf.get_u8();
7620 for v in &mut __struct.cam_definition_uri {
7621 let val = buf.get_u8();
7622 *v = val;
7623 }
7624 __struct.gimbal_device_id = buf.get_u8();
7625 __struct.camera_device_id = buf.get_u8();
7626 Ok(__struct)
7627 }
7628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7629 let mut __tmp = BytesMut::new(bytes);
7630 #[allow(clippy::absurd_extreme_comparisons)]
7631 #[allow(unused_comparisons)]
7632 if __tmp.remaining() < Self::ENCODED_LEN {
7633 panic!(
7634 "buffer is too small (need {} bytes, but got {})",
7635 Self::ENCODED_LEN,
7636 __tmp.remaining(),
7637 )
7638 }
7639 __tmp.put_u32_le(self.time_boot_ms);
7640 __tmp.put_u32_le(self.firmware_version);
7641 __tmp.put_f32_le(self.focal_length);
7642 __tmp.put_f32_le(self.sensor_size_h);
7643 __tmp.put_f32_le(self.sensor_size_v);
7644 __tmp.put_u32_le(self.flags.bits());
7645 __tmp.put_u16_le(self.resolution_h);
7646 __tmp.put_u16_le(self.resolution_v);
7647 __tmp.put_u16_le(self.cam_definition_version);
7648 for val in &self.vendor_name {
7649 __tmp.put_u8(*val);
7650 }
7651 for val in &self.model_name {
7652 __tmp.put_u8(*val);
7653 }
7654 __tmp.put_u8(self.lens_id);
7655 for val in &self.cam_definition_uri {
7656 __tmp.put_u8(*val);
7657 }
7658 __tmp.put_u8(self.gimbal_device_id);
7659 __tmp.put_u8(self.camera_device_id);
7660 if matches!(version, MavlinkVersion::V2) {
7661 let len = __tmp.len();
7662 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7663 } else {
7664 __tmp.len()
7665 }
7666 }
7667}
7668#[doc = "id: 260"]
7669#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7670#[derive(Debug, Clone, PartialEq)]
7671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7673pub struct CAMERA_SETTINGS_DATA {
7674 #[doc = "Timestamp (time since system boot)."]
7675 pub time_boot_ms: u32,
7676 #[doc = "Camera mode"]
7677 pub mode_id: CameraMode,
7678 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7679 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7680 pub zoomLevel: f32,
7681 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7682 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7683 pub focusLevel: f32,
7684 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7685 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7686 pub camera_device_id: u8,
7687}
7688impl CAMERA_SETTINGS_DATA {
7689 pub const ENCODED_LEN: usize = 14usize;
7690 pub const DEFAULT: Self = Self {
7691 time_boot_ms: 0_u32,
7692 mode_id: CameraMode::DEFAULT,
7693 zoomLevel: 0.0_f32,
7694 focusLevel: 0.0_f32,
7695 camera_device_id: 0_u8,
7696 };
7697 #[cfg(feature = "arbitrary")]
7698 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7699 use arbitrary::{Arbitrary, Unstructured};
7700 let mut buf = [0u8; 1024];
7701 rng.fill_bytes(&mut buf);
7702 let mut unstructured = Unstructured::new(&buf);
7703 Self::arbitrary(&mut unstructured).unwrap_or_default()
7704 }
7705}
7706impl Default for CAMERA_SETTINGS_DATA {
7707 fn default() -> Self {
7708 Self::DEFAULT.clone()
7709 }
7710}
7711impl MessageData for CAMERA_SETTINGS_DATA {
7712 type Message = MavMessage;
7713 const ID: u32 = 260u32;
7714 const NAME: &'static str = "CAMERA_SETTINGS";
7715 const EXTRA_CRC: u8 = 146u8;
7716 const ENCODED_LEN: usize = 14usize;
7717 fn deser(
7718 _version: MavlinkVersion,
7719 __input: &[u8],
7720 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7721 let avail_len = __input.len();
7722 let mut payload_buf = [0; Self::ENCODED_LEN];
7723 let mut buf = if avail_len < Self::ENCODED_LEN {
7724 payload_buf[0..avail_len].copy_from_slice(__input);
7725 Bytes::new(&payload_buf)
7726 } else {
7727 Bytes::new(__input)
7728 };
7729 let mut __struct = Self::default();
7730 __struct.time_boot_ms = buf.get_u32_le();
7731 let tmp = buf.get_u8();
7732 __struct.mode_id =
7733 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7734 enum_type: "CameraMode",
7735 value: tmp as u32,
7736 })?;
7737 __struct.zoomLevel = buf.get_f32_le();
7738 __struct.focusLevel = buf.get_f32_le();
7739 __struct.camera_device_id = buf.get_u8();
7740 Ok(__struct)
7741 }
7742 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7743 let mut __tmp = BytesMut::new(bytes);
7744 #[allow(clippy::absurd_extreme_comparisons)]
7745 #[allow(unused_comparisons)]
7746 if __tmp.remaining() < Self::ENCODED_LEN {
7747 panic!(
7748 "buffer is too small (need {} bytes, but got {})",
7749 Self::ENCODED_LEN,
7750 __tmp.remaining(),
7751 )
7752 }
7753 __tmp.put_u32_le(self.time_boot_ms);
7754 __tmp.put_u8(self.mode_id as u8);
7755 __tmp.put_f32_le(self.zoomLevel);
7756 __tmp.put_f32_le(self.focusLevel);
7757 __tmp.put_u8(self.camera_device_id);
7758 if matches!(version, MavlinkVersion::V2) {
7759 let len = __tmp.len();
7760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7761 } else {
7762 __tmp.len()
7763 }
7764 }
7765}
7766#[doc = "id: 277"]
7767#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7768#[derive(Debug, Clone, PartialEq)]
7769#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7771pub struct CAMERA_THERMAL_RANGE_DATA {
7772 #[doc = "Timestamp (time since system boot)."]
7773 pub time_boot_ms: u32,
7774 #[doc = "Temperature max."]
7775 pub max: f32,
7776 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7777 pub max_point_x: f32,
7778 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7779 pub max_point_y: f32,
7780 #[doc = "Temperature min."]
7781 pub min: f32,
7782 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7783 pub min_point_x: f32,
7784 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7785 pub min_point_y: f32,
7786 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7787 pub stream_id: u8,
7788 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7789 pub camera_device_id: u8,
7790}
7791impl CAMERA_THERMAL_RANGE_DATA {
7792 pub const ENCODED_LEN: usize = 30usize;
7793 pub const DEFAULT: Self = Self {
7794 time_boot_ms: 0_u32,
7795 max: 0.0_f32,
7796 max_point_x: 0.0_f32,
7797 max_point_y: 0.0_f32,
7798 min: 0.0_f32,
7799 min_point_x: 0.0_f32,
7800 min_point_y: 0.0_f32,
7801 stream_id: 0_u8,
7802 camera_device_id: 0_u8,
7803 };
7804 #[cfg(feature = "arbitrary")]
7805 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7806 use arbitrary::{Arbitrary, Unstructured};
7807 let mut buf = [0u8; 1024];
7808 rng.fill_bytes(&mut buf);
7809 let mut unstructured = Unstructured::new(&buf);
7810 Self::arbitrary(&mut unstructured).unwrap_or_default()
7811 }
7812}
7813impl Default for CAMERA_THERMAL_RANGE_DATA {
7814 fn default() -> Self {
7815 Self::DEFAULT.clone()
7816 }
7817}
7818impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7819 type Message = MavMessage;
7820 const ID: u32 = 277u32;
7821 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7822 const EXTRA_CRC: u8 = 62u8;
7823 const ENCODED_LEN: usize = 30usize;
7824 fn deser(
7825 _version: MavlinkVersion,
7826 __input: &[u8],
7827 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7828 let avail_len = __input.len();
7829 let mut payload_buf = [0; Self::ENCODED_LEN];
7830 let mut buf = if avail_len < Self::ENCODED_LEN {
7831 payload_buf[0..avail_len].copy_from_slice(__input);
7832 Bytes::new(&payload_buf)
7833 } else {
7834 Bytes::new(__input)
7835 };
7836 let mut __struct = Self::default();
7837 __struct.time_boot_ms = buf.get_u32_le();
7838 __struct.max = buf.get_f32_le();
7839 __struct.max_point_x = buf.get_f32_le();
7840 __struct.max_point_y = buf.get_f32_le();
7841 __struct.min = buf.get_f32_le();
7842 __struct.min_point_x = buf.get_f32_le();
7843 __struct.min_point_y = buf.get_f32_le();
7844 __struct.stream_id = buf.get_u8();
7845 __struct.camera_device_id = buf.get_u8();
7846 Ok(__struct)
7847 }
7848 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7849 let mut __tmp = BytesMut::new(bytes);
7850 #[allow(clippy::absurd_extreme_comparisons)]
7851 #[allow(unused_comparisons)]
7852 if __tmp.remaining() < Self::ENCODED_LEN {
7853 panic!(
7854 "buffer is too small (need {} bytes, but got {})",
7855 Self::ENCODED_LEN,
7856 __tmp.remaining(),
7857 )
7858 }
7859 __tmp.put_u32_le(self.time_boot_ms);
7860 __tmp.put_f32_le(self.max);
7861 __tmp.put_f32_le(self.max_point_x);
7862 __tmp.put_f32_le(self.max_point_y);
7863 __tmp.put_f32_le(self.min);
7864 __tmp.put_f32_le(self.min_point_x);
7865 __tmp.put_f32_le(self.min_point_y);
7866 __tmp.put_u8(self.stream_id);
7867 __tmp.put_u8(self.camera_device_id);
7868 if matches!(version, MavlinkVersion::V2) {
7869 let len = __tmp.len();
7870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7871 } else {
7872 __tmp.len()
7873 }
7874 }
7875}
7876#[doc = "id: 276"]
7877#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7878#[derive(Debug, Clone, PartialEq)]
7879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7880#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7881pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7882 #[doc = "Latitude of tracked object"]
7883 pub lat: i32,
7884 #[doc = "Longitude of tracked object"]
7885 pub lon: i32,
7886 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7887 pub alt: f32,
7888 #[doc = "Horizontal accuracy. NAN if unknown"]
7889 pub h_acc: f32,
7890 #[doc = "Vertical accuracy. NAN if unknown"]
7891 pub v_acc: f32,
7892 #[doc = "North velocity of tracked object. NAN if unknown"]
7893 pub vel_n: f32,
7894 #[doc = "East velocity of tracked object. NAN if unknown"]
7895 pub vel_e: f32,
7896 #[doc = "Down velocity of tracked object. NAN if unknown"]
7897 pub vel_d: f32,
7898 #[doc = "Velocity accuracy. NAN if unknown"]
7899 pub vel_acc: f32,
7900 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7901 pub dist: f32,
7902 #[doc = "Heading in radians, in NED. NAN if unknown"]
7903 pub hdg: f32,
7904 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7905 pub hdg_acc: f32,
7906 #[doc = "Current tracking status"]
7907 pub tracking_status: CameraTrackingStatusFlags,
7908 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7909 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7910 pub camera_device_id: u8,
7911}
7912impl CAMERA_TRACKING_GEO_STATUS_DATA {
7913 pub const ENCODED_LEN: usize = 50usize;
7914 pub const DEFAULT: Self = Self {
7915 lat: 0_i32,
7916 lon: 0_i32,
7917 alt: 0.0_f32,
7918 h_acc: 0.0_f32,
7919 v_acc: 0.0_f32,
7920 vel_n: 0.0_f32,
7921 vel_e: 0.0_f32,
7922 vel_d: 0.0_f32,
7923 vel_acc: 0.0_f32,
7924 dist: 0.0_f32,
7925 hdg: 0.0_f32,
7926 hdg_acc: 0.0_f32,
7927 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7928 camera_device_id: 0_u8,
7929 };
7930 #[cfg(feature = "arbitrary")]
7931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7932 use arbitrary::{Arbitrary, Unstructured};
7933 let mut buf = [0u8; 1024];
7934 rng.fill_bytes(&mut buf);
7935 let mut unstructured = Unstructured::new(&buf);
7936 Self::arbitrary(&mut unstructured).unwrap_or_default()
7937 }
7938}
7939impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7940 fn default() -> Self {
7941 Self::DEFAULT.clone()
7942 }
7943}
7944impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7945 type Message = MavMessage;
7946 const ID: u32 = 276u32;
7947 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7948 const EXTRA_CRC: u8 = 18u8;
7949 const ENCODED_LEN: usize = 50usize;
7950 fn deser(
7951 _version: MavlinkVersion,
7952 __input: &[u8],
7953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7954 let avail_len = __input.len();
7955 let mut payload_buf = [0; Self::ENCODED_LEN];
7956 let mut buf = if avail_len < Self::ENCODED_LEN {
7957 payload_buf[0..avail_len].copy_from_slice(__input);
7958 Bytes::new(&payload_buf)
7959 } else {
7960 Bytes::new(__input)
7961 };
7962 let mut __struct = Self::default();
7963 __struct.lat = buf.get_i32_le();
7964 __struct.lon = buf.get_i32_le();
7965 __struct.alt = buf.get_f32_le();
7966 __struct.h_acc = buf.get_f32_le();
7967 __struct.v_acc = buf.get_f32_le();
7968 __struct.vel_n = buf.get_f32_le();
7969 __struct.vel_e = buf.get_f32_le();
7970 __struct.vel_d = buf.get_f32_le();
7971 __struct.vel_acc = buf.get_f32_le();
7972 __struct.dist = buf.get_f32_le();
7973 __struct.hdg = buf.get_f32_le();
7974 __struct.hdg_acc = buf.get_f32_le();
7975 let tmp = buf.get_u8();
7976 __struct.tracking_status =
7977 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7978 enum_type: "CameraTrackingStatusFlags",
7979 value: tmp as u32,
7980 })?;
7981 __struct.camera_device_id = buf.get_u8();
7982 Ok(__struct)
7983 }
7984 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7985 let mut __tmp = BytesMut::new(bytes);
7986 #[allow(clippy::absurd_extreme_comparisons)]
7987 #[allow(unused_comparisons)]
7988 if __tmp.remaining() < Self::ENCODED_LEN {
7989 panic!(
7990 "buffer is too small (need {} bytes, but got {})",
7991 Self::ENCODED_LEN,
7992 __tmp.remaining(),
7993 )
7994 }
7995 __tmp.put_i32_le(self.lat);
7996 __tmp.put_i32_le(self.lon);
7997 __tmp.put_f32_le(self.alt);
7998 __tmp.put_f32_le(self.h_acc);
7999 __tmp.put_f32_le(self.v_acc);
8000 __tmp.put_f32_le(self.vel_n);
8001 __tmp.put_f32_le(self.vel_e);
8002 __tmp.put_f32_le(self.vel_d);
8003 __tmp.put_f32_le(self.vel_acc);
8004 __tmp.put_f32_le(self.dist);
8005 __tmp.put_f32_le(self.hdg);
8006 __tmp.put_f32_le(self.hdg_acc);
8007 __tmp.put_u8(self.tracking_status as u8);
8008 __tmp.put_u8(self.camera_device_id);
8009 if matches!(version, MavlinkVersion::V2) {
8010 let len = __tmp.len();
8011 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8012 } else {
8013 __tmp.len()
8014 }
8015 }
8016}
8017#[doc = "id: 275"]
8018#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8019#[derive(Debug, Clone, PartialEq)]
8020#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8021#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8022pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
8023 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8024 pub point_x: f32,
8025 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8026 pub point_y: f32,
8027 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
8028 pub radius: f32,
8029 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8030 pub rec_top_x: f32,
8031 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8032 pub rec_top_y: f32,
8033 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8034 pub rec_bottom_x: f32,
8035 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8036 pub rec_bottom_y: f32,
8037 #[doc = "Current tracking status"]
8038 pub tracking_status: CameraTrackingStatusFlags,
8039 #[doc = "Current tracking mode"]
8040 pub tracking_mode: CameraTrackingMode,
8041 #[doc = "Defines location of target data"]
8042 pub target_data: CameraTrackingTargetData,
8043 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8044 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8045 pub camera_device_id: u8,
8046}
8047impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
8048 pub const ENCODED_LEN: usize = 32usize;
8049 pub const DEFAULT: Self = Self {
8050 point_x: 0.0_f32,
8051 point_y: 0.0_f32,
8052 radius: 0.0_f32,
8053 rec_top_x: 0.0_f32,
8054 rec_top_y: 0.0_f32,
8055 rec_bottom_x: 0.0_f32,
8056 rec_bottom_y: 0.0_f32,
8057 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8058 tracking_mode: CameraTrackingMode::DEFAULT,
8059 target_data: CameraTrackingTargetData::DEFAULT,
8060 camera_device_id: 0_u8,
8061 };
8062 #[cfg(feature = "arbitrary")]
8063 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8064 use arbitrary::{Arbitrary, Unstructured};
8065 let mut buf = [0u8; 1024];
8066 rng.fill_bytes(&mut buf);
8067 let mut unstructured = Unstructured::new(&buf);
8068 Self::arbitrary(&mut unstructured).unwrap_or_default()
8069 }
8070}
8071impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8072 fn default() -> Self {
8073 Self::DEFAULT.clone()
8074 }
8075}
8076impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8077 type Message = MavMessage;
8078 const ID: u32 = 275u32;
8079 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8080 const EXTRA_CRC: u8 = 126u8;
8081 const ENCODED_LEN: usize = 32usize;
8082 fn deser(
8083 _version: MavlinkVersion,
8084 __input: &[u8],
8085 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8086 let avail_len = __input.len();
8087 let mut payload_buf = [0; Self::ENCODED_LEN];
8088 let mut buf = if avail_len < Self::ENCODED_LEN {
8089 payload_buf[0..avail_len].copy_from_slice(__input);
8090 Bytes::new(&payload_buf)
8091 } else {
8092 Bytes::new(__input)
8093 };
8094 let mut __struct = Self::default();
8095 __struct.point_x = buf.get_f32_le();
8096 __struct.point_y = buf.get_f32_le();
8097 __struct.radius = buf.get_f32_le();
8098 __struct.rec_top_x = buf.get_f32_le();
8099 __struct.rec_top_y = buf.get_f32_le();
8100 __struct.rec_bottom_x = buf.get_f32_le();
8101 __struct.rec_bottom_y = buf.get_f32_le();
8102 let tmp = buf.get_u8();
8103 __struct.tracking_status =
8104 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8105 enum_type: "CameraTrackingStatusFlags",
8106 value: tmp as u32,
8107 })?;
8108 let tmp = buf.get_u8();
8109 __struct.tracking_mode =
8110 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8111 enum_type: "CameraTrackingMode",
8112 value: tmp as u32,
8113 })?;
8114 let tmp = buf.get_u8();
8115 __struct.target_data =
8116 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
8117 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8118 flag_type: "CameraTrackingTargetData",
8119 value: tmp as u32,
8120 })?;
8121 __struct.camera_device_id = buf.get_u8();
8122 Ok(__struct)
8123 }
8124 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8125 let mut __tmp = BytesMut::new(bytes);
8126 #[allow(clippy::absurd_extreme_comparisons)]
8127 #[allow(unused_comparisons)]
8128 if __tmp.remaining() < Self::ENCODED_LEN {
8129 panic!(
8130 "buffer is too small (need {} bytes, but got {})",
8131 Self::ENCODED_LEN,
8132 __tmp.remaining(),
8133 )
8134 }
8135 __tmp.put_f32_le(self.point_x);
8136 __tmp.put_f32_le(self.point_y);
8137 __tmp.put_f32_le(self.radius);
8138 __tmp.put_f32_le(self.rec_top_x);
8139 __tmp.put_f32_le(self.rec_top_y);
8140 __tmp.put_f32_le(self.rec_bottom_x);
8141 __tmp.put_f32_le(self.rec_bottom_y);
8142 __tmp.put_u8(self.tracking_status as u8);
8143 __tmp.put_u8(self.tracking_mode as u8);
8144 __tmp.put_u8(self.target_data.bits());
8145 __tmp.put_u8(self.camera_device_id);
8146 if matches!(version, MavlinkVersion::V2) {
8147 let len = __tmp.len();
8148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8149 } else {
8150 __tmp.len()
8151 }
8152 }
8153}
8154#[doc = "id: 112"]
8155#[doc = "Camera-IMU triggering and synchronisation message."]
8156#[derive(Debug, Clone, PartialEq)]
8157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8159pub struct CAMERA_TRIGGER_DATA {
8160 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8161 pub time_usec: u64,
8162 #[doc = "Image frame sequence"]
8163 pub seq: u32,
8164}
8165impl CAMERA_TRIGGER_DATA {
8166 pub const ENCODED_LEN: usize = 12usize;
8167 pub const DEFAULT: Self = Self {
8168 time_usec: 0_u64,
8169 seq: 0_u32,
8170 };
8171 #[cfg(feature = "arbitrary")]
8172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8173 use arbitrary::{Arbitrary, Unstructured};
8174 let mut buf = [0u8; 1024];
8175 rng.fill_bytes(&mut buf);
8176 let mut unstructured = Unstructured::new(&buf);
8177 Self::arbitrary(&mut unstructured).unwrap_or_default()
8178 }
8179}
8180impl Default for CAMERA_TRIGGER_DATA {
8181 fn default() -> Self {
8182 Self::DEFAULT.clone()
8183 }
8184}
8185impl MessageData for CAMERA_TRIGGER_DATA {
8186 type Message = MavMessage;
8187 const ID: u32 = 112u32;
8188 const NAME: &'static str = "CAMERA_TRIGGER";
8189 const EXTRA_CRC: u8 = 174u8;
8190 const ENCODED_LEN: usize = 12usize;
8191 fn deser(
8192 _version: MavlinkVersion,
8193 __input: &[u8],
8194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8195 let avail_len = __input.len();
8196 let mut payload_buf = [0; Self::ENCODED_LEN];
8197 let mut buf = if avail_len < Self::ENCODED_LEN {
8198 payload_buf[0..avail_len].copy_from_slice(__input);
8199 Bytes::new(&payload_buf)
8200 } else {
8201 Bytes::new(__input)
8202 };
8203 let mut __struct = Self::default();
8204 __struct.time_usec = buf.get_u64_le();
8205 __struct.seq = buf.get_u32_le();
8206 Ok(__struct)
8207 }
8208 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8209 let mut __tmp = BytesMut::new(bytes);
8210 #[allow(clippy::absurd_extreme_comparisons)]
8211 #[allow(unused_comparisons)]
8212 if __tmp.remaining() < Self::ENCODED_LEN {
8213 panic!(
8214 "buffer is too small (need {} bytes, but got {})",
8215 Self::ENCODED_LEN,
8216 __tmp.remaining(),
8217 )
8218 }
8219 __tmp.put_u64_le(self.time_usec);
8220 __tmp.put_u32_le(self.seq);
8221 if matches!(version, MavlinkVersion::V2) {
8222 let len = __tmp.len();
8223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8224 } else {
8225 __tmp.len()
8226 }
8227 }
8228}
8229#[doc = "id: 387"]
8230#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8231#[derive(Debug, Clone, PartialEq)]
8232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8234pub struct CANFD_FRAME_DATA {
8235 #[doc = "Frame ID"]
8236 pub id: u32,
8237 #[doc = "System ID."]
8238 pub target_system: u8,
8239 #[doc = "Component ID."]
8240 pub target_component: u8,
8241 #[doc = "bus number"]
8242 pub bus: u8,
8243 #[doc = "Frame length"]
8244 pub len: u8,
8245 #[doc = "Frame data"]
8246 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8247 pub data: [u8; 64],
8248}
8249impl CANFD_FRAME_DATA {
8250 pub const ENCODED_LEN: usize = 72usize;
8251 pub const DEFAULT: Self = Self {
8252 id: 0_u32,
8253 target_system: 0_u8,
8254 target_component: 0_u8,
8255 bus: 0_u8,
8256 len: 0_u8,
8257 data: [0_u8; 64usize],
8258 };
8259 #[cfg(feature = "arbitrary")]
8260 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8261 use arbitrary::{Arbitrary, Unstructured};
8262 let mut buf = [0u8; 1024];
8263 rng.fill_bytes(&mut buf);
8264 let mut unstructured = Unstructured::new(&buf);
8265 Self::arbitrary(&mut unstructured).unwrap_or_default()
8266 }
8267}
8268impl Default for CANFD_FRAME_DATA {
8269 fn default() -> Self {
8270 Self::DEFAULT.clone()
8271 }
8272}
8273impl MessageData for CANFD_FRAME_DATA {
8274 type Message = MavMessage;
8275 const ID: u32 = 387u32;
8276 const NAME: &'static str = "CANFD_FRAME";
8277 const EXTRA_CRC: u8 = 4u8;
8278 const ENCODED_LEN: usize = 72usize;
8279 fn deser(
8280 _version: MavlinkVersion,
8281 __input: &[u8],
8282 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8283 let avail_len = __input.len();
8284 let mut payload_buf = [0; Self::ENCODED_LEN];
8285 let mut buf = if avail_len < Self::ENCODED_LEN {
8286 payload_buf[0..avail_len].copy_from_slice(__input);
8287 Bytes::new(&payload_buf)
8288 } else {
8289 Bytes::new(__input)
8290 };
8291 let mut __struct = Self::default();
8292 __struct.id = buf.get_u32_le();
8293 __struct.target_system = buf.get_u8();
8294 __struct.target_component = buf.get_u8();
8295 __struct.bus = buf.get_u8();
8296 __struct.len = buf.get_u8();
8297 for v in &mut __struct.data {
8298 let val = buf.get_u8();
8299 *v = val;
8300 }
8301 Ok(__struct)
8302 }
8303 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8304 let mut __tmp = BytesMut::new(bytes);
8305 #[allow(clippy::absurd_extreme_comparisons)]
8306 #[allow(unused_comparisons)]
8307 if __tmp.remaining() < Self::ENCODED_LEN {
8308 panic!(
8309 "buffer is too small (need {} bytes, but got {})",
8310 Self::ENCODED_LEN,
8311 __tmp.remaining(),
8312 )
8313 }
8314 __tmp.put_u32_le(self.id);
8315 __tmp.put_u8(self.target_system);
8316 __tmp.put_u8(self.target_component);
8317 __tmp.put_u8(self.bus);
8318 __tmp.put_u8(self.len);
8319 for val in &self.data {
8320 __tmp.put_u8(*val);
8321 }
8322 if matches!(version, MavlinkVersion::V2) {
8323 let len = __tmp.len();
8324 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8325 } else {
8326 __tmp.len()
8327 }
8328 }
8329}
8330#[doc = "id: 388"]
8331#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8332#[derive(Debug, Clone, PartialEq)]
8333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8335pub struct CAN_FILTER_MODIFY_DATA {
8336 #[doc = "filter IDs, length num_ids"]
8337 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8338 pub ids: [u16; 16],
8339 #[doc = "System ID."]
8340 pub target_system: u8,
8341 #[doc = "Component ID."]
8342 pub target_component: u8,
8343 #[doc = "bus number"]
8344 pub bus: u8,
8345 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8346 pub operation: CanFilterOp,
8347 #[doc = "number of IDs in filter list"]
8348 pub num_ids: u8,
8349}
8350impl CAN_FILTER_MODIFY_DATA {
8351 pub const ENCODED_LEN: usize = 37usize;
8352 pub const DEFAULT: Self = Self {
8353 ids: [0_u16; 16usize],
8354 target_system: 0_u8,
8355 target_component: 0_u8,
8356 bus: 0_u8,
8357 operation: CanFilterOp::DEFAULT,
8358 num_ids: 0_u8,
8359 };
8360 #[cfg(feature = "arbitrary")]
8361 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8362 use arbitrary::{Arbitrary, Unstructured};
8363 let mut buf = [0u8; 1024];
8364 rng.fill_bytes(&mut buf);
8365 let mut unstructured = Unstructured::new(&buf);
8366 Self::arbitrary(&mut unstructured).unwrap_or_default()
8367 }
8368}
8369impl Default for CAN_FILTER_MODIFY_DATA {
8370 fn default() -> Self {
8371 Self::DEFAULT.clone()
8372 }
8373}
8374impl MessageData for CAN_FILTER_MODIFY_DATA {
8375 type Message = MavMessage;
8376 const ID: u32 = 388u32;
8377 const NAME: &'static str = "CAN_FILTER_MODIFY";
8378 const EXTRA_CRC: u8 = 8u8;
8379 const ENCODED_LEN: usize = 37usize;
8380 fn deser(
8381 _version: MavlinkVersion,
8382 __input: &[u8],
8383 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8384 let avail_len = __input.len();
8385 let mut payload_buf = [0; Self::ENCODED_LEN];
8386 let mut buf = if avail_len < Self::ENCODED_LEN {
8387 payload_buf[0..avail_len].copy_from_slice(__input);
8388 Bytes::new(&payload_buf)
8389 } else {
8390 Bytes::new(__input)
8391 };
8392 let mut __struct = Self::default();
8393 for v in &mut __struct.ids {
8394 let val = buf.get_u16_le();
8395 *v = val;
8396 }
8397 __struct.target_system = buf.get_u8();
8398 __struct.target_component = buf.get_u8();
8399 __struct.bus = buf.get_u8();
8400 let tmp = buf.get_u8();
8401 __struct.operation =
8402 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8403 enum_type: "CanFilterOp",
8404 value: tmp as u32,
8405 })?;
8406 __struct.num_ids = buf.get_u8();
8407 Ok(__struct)
8408 }
8409 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8410 let mut __tmp = BytesMut::new(bytes);
8411 #[allow(clippy::absurd_extreme_comparisons)]
8412 #[allow(unused_comparisons)]
8413 if __tmp.remaining() < Self::ENCODED_LEN {
8414 panic!(
8415 "buffer is too small (need {} bytes, but got {})",
8416 Self::ENCODED_LEN,
8417 __tmp.remaining(),
8418 )
8419 }
8420 for val in &self.ids {
8421 __tmp.put_u16_le(*val);
8422 }
8423 __tmp.put_u8(self.target_system);
8424 __tmp.put_u8(self.target_component);
8425 __tmp.put_u8(self.bus);
8426 __tmp.put_u8(self.operation as u8);
8427 __tmp.put_u8(self.num_ids);
8428 if matches!(version, MavlinkVersion::V2) {
8429 let len = __tmp.len();
8430 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8431 } else {
8432 __tmp.len()
8433 }
8434 }
8435}
8436#[doc = "id: 386"]
8437#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8438#[derive(Debug, Clone, PartialEq)]
8439#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8440#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8441pub struct CAN_FRAME_DATA {
8442 #[doc = "Frame ID"]
8443 pub id: u32,
8444 #[doc = "System ID."]
8445 pub target_system: u8,
8446 #[doc = "Component ID."]
8447 pub target_component: u8,
8448 #[doc = "Bus number"]
8449 pub bus: u8,
8450 #[doc = "Frame length"]
8451 pub len: u8,
8452 #[doc = "Frame data"]
8453 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8454 pub data: [u8; 8],
8455}
8456impl CAN_FRAME_DATA {
8457 pub const ENCODED_LEN: usize = 16usize;
8458 pub const DEFAULT: Self = Self {
8459 id: 0_u32,
8460 target_system: 0_u8,
8461 target_component: 0_u8,
8462 bus: 0_u8,
8463 len: 0_u8,
8464 data: [0_u8; 8usize],
8465 };
8466 #[cfg(feature = "arbitrary")]
8467 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8468 use arbitrary::{Arbitrary, Unstructured};
8469 let mut buf = [0u8; 1024];
8470 rng.fill_bytes(&mut buf);
8471 let mut unstructured = Unstructured::new(&buf);
8472 Self::arbitrary(&mut unstructured).unwrap_or_default()
8473 }
8474}
8475impl Default for CAN_FRAME_DATA {
8476 fn default() -> Self {
8477 Self::DEFAULT.clone()
8478 }
8479}
8480impl MessageData for CAN_FRAME_DATA {
8481 type Message = MavMessage;
8482 const ID: u32 = 386u32;
8483 const NAME: &'static str = "CAN_FRAME";
8484 const EXTRA_CRC: u8 = 132u8;
8485 const ENCODED_LEN: usize = 16usize;
8486 fn deser(
8487 _version: MavlinkVersion,
8488 __input: &[u8],
8489 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8490 let avail_len = __input.len();
8491 let mut payload_buf = [0; Self::ENCODED_LEN];
8492 let mut buf = if avail_len < Self::ENCODED_LEN {
8493 payload_buf[0..avail_len].copy_from_slice(__input);
8494 Bytes::new(&payload_buf)
8495 } else {
8496 Bytes::new(__input)
8497 };
8498 let mut __struct = Self::default();
8499 __struct.id = buf.get_u32_le();
8500 __struct.target_system = buf.get_u8();
8501 __struct.target_component = buf.get_u8();
8502 __struct.bus = buf.get_u8();
8503 __struct.len = buf.get_u8();
8504 for v in &mut __struct.data {
8505 let val = buf.get_u8();
8506 *v = val;
8507 }
8508 Ok(__struct)
8509 }
8510 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8511 let mut __tmp = BytesMut::new(bytes);
8512 #[allow(clippy::absurd_extreme_comparisons)]
8513 #[allow(unused_comparisons)]
8514 if __tmp.remaining() < Self::ENCODED_LEN {
8515 panic!(
8516 "buffer is too small (need {} bytes, but got {})",
8517 Self::ENCODED_LEN,
8518 __tmp.remaining(),
8519 )
8520 }
8521 __tmp.put_u32_le(self.id);
8522 __tmp.put_u8(self.target_system);
8523 __tmp.put_u8(self.target_component);
8524 __tmp.put_u8(self.bus);
8525 __tmp.put_u8(self.len);
8526 for val in &self.data {
8527 __tmp.put_u8(*val);
8528 }
8529 if matches!(version, MavlinkVersion::V2) {
8530 let len = __tmp.len();
8531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8532 } else {
8533 __tmp.len()
8534 }
8535 }
8536}
8537#[doc = "id: 336"]
8538#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8539#[derive(Debug, Clone, PartialEq)]
8540#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8542pub struct CELLULAR_CONFIG_DATA {
8543 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8544 pub enable_lte: u8,
8545 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8546 pub enable_pin: u8,
8547 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8548 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8549 pub pin: [u8; 16],
8550 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8551 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8552 pub new_pin: [u8; 16],
8553 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8554 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8555 pub apn: [u8; 32],
8556 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8557 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8558 pub puk: [u8; 16],
8559 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8560 pub roaming: u8,
8561 #[doc = "Message acceptance response (sent back to GS)."]
8562 pub response: CellularConfigResponse,
8563}
8564impl CELLULAR_CONFIG_DATA {
8565 pub const ENCODED_LEN: usize = 84usize;
8566 pub const DEFAULT: Self = Self {
8567 enable_lte: 0_u8,
8568 enable_pin: 0_u8,
8569 pin: [0_u8; 16usize],
8570 new_pin: [0_u8; 16usize],
8571 apn: [0_u8; 32usize],
8572 puk: [0_u8; 16usize],
8573 roaming: 0_u8,
8574 response: CellularConfigResponse::DEFAULT,
8575 };
8576 #[cfg(feature = "arbitrary")]
8577 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8578 use arbitrary::{Arbitrary, Unstructured};
8579 let mut buf = [0u8; 1024];
8580 rng.fill_bytes(&mut buf);
8581 let mut unstructured = Unstructured::new(&buf);
8582 Self::arbitrary(&mut unstructured).unwrap_or_default()
8583 }
8584}
8585impl Default for CELLULAR_CONFIG_DATA {
8586 fn default() -> Self {
8587 Self::DEFAULT.clone()
8588 }
8589}
8590impl MessageData for CELLULAR_CONFIG_DATA {
8591 type Message = MavMessage;
8592 const ID: u32 = 336u32;
8593 const NAME: &'static str = "CELLULAR_CONFIG";
8594 const EXTRA_CRC: u8 = 245u8;
8595 const ENCODED_LEN: usize = 84usize;
8596 fn deser(
8597 _version: MavlinkVersion,
8598 __input: &[u8],
8599 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8600 let avail_len = __input.len();
8601 let mut payload_buf = [0; Self::ENCODED_LEN];
8602 let mut buf = if avail_len < Self::ENCODED_LEN {
8603 payload_buf[0..avail_len].copy_from_slice(__input);
8604 Bytes::new(&payload_buf)
8605 } else {
8606 Bytes::new(__input)
8607 };
8608 let mut __struct = Self::default();
8609 __struct.enable_lte = buf.get_u8();
8610 __struct.enable_pin = buf.get_u8();
8611 for v in &mut __struct.pin {
8612 let val = buf.get_u8();
8613 *v = val;
8614 }
8615 for v in &mut __struct.new_pin {
8616 let val = buf.get_u8();
8617 *v = val;
8618 }
8619 for v in &mut __struct.apn {
8620 let val = buf.get_u8();
8621 *v = val;
8622 }
8623 for v in &mut __struct.puk {
8624 let val = buf.get_u8();
8625 *v = val;
8626 }
8627 __struct.roaming = buf.get_u8();
8628 let tmp = buf.get_u8();
8629 __struct.response =
8630 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8631 enum_type: "CellularConfigResponse",
8632 value: tmp as u32,
8633 })?;
8634 Ok(__struct)
8635 }
8636 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8637 let mut __tmp = BytesMut::new(bytes);
8638 #[allow(clippy::absurd_extreme_comparisons)]
8639 #[allow(unused_comparisons)]
8640 if __tmp.remaining() < Self::ENCODED_LEN {
8641 panic!(
8642 "buffer is too small (need {} bytes, but got {})",
8643 Self::ENCODED_LEN,
8644 __tmp.remaining(),
8645 )
8646 }
8647 __tmp.put_u8(self.enable_lte);
8648 __tmp.put_u8(self.enable_pin);
8649 for val in &self.pin {
8650 __tmp.put_u8(*val);
8651 }
8652 for val in &self.new_pin {
8653 __tmp.put_u8(*val);
8654 }
8655 for val in &self.apn {
8656 __tmp.put_u8(*val);
8657 }
8658 for val in &self.puk {
8659 __tmp.put_u8(*val);
8660 }
8661 __tmp.put_u8(self.roaming);
8662 __tmp.put_u8(self.response as u8);
8663 if matches!(version, MavlinkVersion::V2) {
8664 let len = __tmp.len();
8665 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8666 } else {
8667 __tmp.len()
8668 }
8669 }
8670}
8671#[doc = "id: 334"]
8672#[doc = "Report current used cellular network status."]
8673#[derive(Debug, Clone, PartialEq)]
8674#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8675#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8676pub struct CELLULAR_STATUS_DATA {
8677 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8678 pub mcc: u16,
8679 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8680 pub mnc: u16,
8681 #[doc = "Location area code. If unknown, set to 0"]
8682 pub lac: u16,
8683 #[doc = "Cellular modem status"]
8684 pub status: CellularStatusFlag,
8685 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8686 pub failure_reason: CellularNetworkFailedReason,
8687 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8688 pub mavtype: CellularNetworkRadioType,
8689 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8690 pub quality: u8,
8691}
8692impl CELLULAR_STATUS_DATA {
8693 pub const ENCODED_LEN: usize = 10usize;
8694 pub const DEFAULT: Self = Self {
8695 mcc: 0_u16,
8696 mnc: 0_u16,
8697 lac: 0_u16,
8698 status: CellularStatusFlag::DEFAULT,
8699 failure_reason: CellularNetworkFailedReason::DEFAULT,
8700 mavtype: CellularNetworkRadioType::DEFAULT,
8701 quality: 0_u8,
8702 };
8703 #[cfg(feature = "arbitrary")]
8704 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8705 use arbitrary::{Arbitrary, Unstructured};
8706 let mut buf = [0u8; 1024];
8707 rng.fill_bytes(&mut buf);
8708 let mut unstructured = Unstructured::new(&buf);
8709 Self::arbitrary(&mut unstructured).unwrap_or_default()
8710 }
8711}
8712impl Default for CELLULAR_STATUS_DATA {
8713 fn default() -> Self {
8714 Self::DEFAULT.clone()
8715 }
8716}
8717impl MessageData for CELLULAR_STATUS_DATA {
8718 type Message = MavMessage;
8719 const ID: u32 = 334u32;
8720 const NAME: &'static str = "CELLULAR_STATUS";
8721 const EXTRA_CRC: u8 = 72u8;
8722 const ENCODED_LEN: usize = 10usize;
8723 fn deser(
8724 _version: MavlinkVersion,
8725 __input: &[u8],
8726 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8727 let avail_len = __input.len();
8728 let mut payload_buf = [0; Self::ENCODED_LEN];
8729 let mut buf = if avail_len < Self::ENCODED_LEN {
8730 payload_buf[0..avail_len].copy_from_slice(__input);
8731 Bytes::new(&payload_buf)
8732 } else {
8733 Bytes::new(__input)
8734 };
8735 let mut __struct = Self::default();
8736 __struct.mcc = buf.get_u16_le();
8737 __struct.mnc = buf.get_u16_le();
8738 __struct.lac = buf.get_u16_le();
8739 let tmp = buf.get_u8();
8740 __struct.status =
8741 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8742 enum_type: "CellularStatusFlag",
8743 value: tmp as u32,
8744 })?;
8745 let tmp = buf.get_u8();
8746 __struct.failure_reason =
8747 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8748 enum_type: "CellularNetworkFailedReason",
8749 value: tmp as u32,
8750 })?;
8751 let tmp = buf.get_u8();
8752 __struct.mavtype =
8753 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8754 enum_type: "CellularNetworkRadioType",
8755 value: tmp as u32,
8756 })?;
8757 __struct.quality = buf.get_u8();
8758 Ok(__struct)
8759 }
8760 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8761 let mut __tmp = BytesMut::new(bytes);
8762 #[allow(clippy::absurd_extreme_comparisons)]
8763 #[allow(unused_comparisons)]
8764 if __tmp.remaining() < Self::ENCODED_LEN {
8765 panic!(
8766 "buffer is too small (need {} bytes, but got {})",
8767 Self::ENCODED_LEN,
8768 __tmp.remaining(),
8769 )
8770 }
8771 __tmp.put_u16_le(self.mcc);
8772 __tmp.put_u16_le(self.mnc);
8773 __tmp.put_u16_le(self.lac);
8774 __tmp.put_u8(self.status as u8);
8775 __tmp.put_u8(self.failure_reason as u8);
8776 __tmp.put_u8(self.mavtype as u8);
8777 __tmp.put_u8(self.quality);
8778 if matches!(version, MavlinkVersion::V2) {
8779 let len = __tmp.len();
8780 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8781 } else {
8782 __tmp.len()
8783 }
8784 }
8785}
8786#[doc = "id: 5"]
8787#[doc = "Request to control this MAV."]
8788#[derive(Debug, Clone, PartialEq)]
8789#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8790#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8791pub struct CHANGE_OPERATOR_CONTROL_DATA {
8792 #[doc = "System the GCS requests control for"]
8793 pub target_system: u8,
8794 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8795 pub control_request: u8,
8796 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8797 pub version: u8,
8798 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8799 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8800 pub passkey: [u8; 25],
8801}
8802impl CHANGE_OPERATOR_CONTROL_DATA {
8803 pub const ENCODED_LEN: usize = 28usize;
8804 pub const DEFAULT: Self = Self {
8805 target_system: 0_u8,
8806 control_request: 0_u8,
8807 version: 0_u8,
8808 passkey: [0_u8; 25usize],
8809 };
8810 #[cfg(feature = "arbitrary")]
8811 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8812 use arbitrary::{Arbitrary, Unstructured};
8813 let mut buf = [0u8; 1024];
8814 rng.fill_bytes(&mut buf);
8815 let mut unstructured = Unstructured::new(&buf);
8816 Self::arbitrary(&mut unstructured).unwrap_or_default()
8817 }
8818}
8819impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8820 fn default() -> Self {
8821 Self::DEFAULT.clone()
8822 }
8823}
8824impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8825 type Message = MavMessage;
8826 const ID: u32 = 5u32;
8827 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8828 const EXTRA_CRC: u8 = 217u8;
8829 const ENCODED_LEN: usize = 28usize;
8830 fn deser(
8831 _version: MavlinkVersion,
8832 __input: &[u8],
8833 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8834 let avail_len = __input.len();
8835 let mut payload_buf = [0; Self::ENCODED_LEN];
8836 let mut buf = if avail_len < Self::ENCODED_LEN {
8837 payload_buf[0..avail_len].copy_from_slice(__input);
8838 Bytes::new(&payload_buf)
8839 } else {
8840 Bytes::new(__input)
8841 };
8842 let mut __struct = Self::default();
8843 __struct.target_system = buf.get_u8();
8844 __struct.control_request = buf.get_u8();
8845 __struct.version = buf.get_u8();
8846 for v in &mut __struct.passkey {
8847 let val = buf.get_u8();
8848 *v = val;
8849 }
8850 Ok(__struct)
8851 }
8852 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8853 let mut __tmp = BytesMut::new(bytes);
8854 #[allow(clippy::absurd_extreme_comparisons)]
8855 #[allow(unused_comparisons)]
8856 if __tmp.remaining() < Self::ENCODED_LEN {
8857 panic!(
8858 "buffer is too small (need {} bytes, but got {})",
8859 Self::ENCODED_LEN,
8860 __tmp.remaining(),
8861 )
8862 }
8863 __tmp.put_u8(self.target_system);
8864 __tmp.put_u8(self.control_request);
8865 __tmp.put_u8(self.version);
8866 for val in &self.passkey {
8867 __tmp.put_u8(*val);
8868 }
8869 if matches!(version, MavlinkVersion::V2) {
8870 let len = __tmp.len();
8871 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8872 } else {
8873 __tmp.len()
8874 }
8875 }
8876}
8877#[doc = "id: 6"]
8878#[doc = "Accept / deny control of this MAV."]
8879#[derive(Debug, Clone, PartialEq)]
8880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8882pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8883 #[doc = "ID of the GCS this message"]
8884 pub gcs_system_id: u8,
8885 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8886 pub control_request: u8,
8887 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8888 pub ack: u8,
8889}
8890impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8891 pub const ENCODED_LEN: usize = 3usize;
8892 pub const DEFAULT: Self = Self {
8893 gcs_system_id: 0_u8,
8894 control_request: 0_u8,
8895 ack: 0_u8,
8896 };
8897 #[cfg(feature = "arbitrary")]
8898 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8899 use arbitrary::{Arbitrary, Unstructured};
8900 let mut buf = [0u8; 1024];
8901 rng.fill_bytes(&mut buf);
8902 let mut unstructured = Unstructured::new(&buf);
8903 Self::arbitrary(&mut unstructured).unwrap_or_default()
8904 }
8905}
8906impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8907 fn default() -> Self {
8908 Self::DEFAULT.clone()
8909 }
8910}
8911impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8912 type Message = MavMessage;
8913 const ID: u32 = 6u32;
8914 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8915 const EXTRA_CRC: u8 = 104u8;
8916 const ENCODED_LEN: usize = 3usize;
8917 fn deser(
8918 _version: MavlinkVersion,
8919 __input: &[u8],
8920 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8921 let avail_len = __input.len();
8922 let mut payload_buf = [0; Self::ENCODED_LEN];
8923 let mut buf = if avail_len < Self::ENCODED_LEN {
8924 payload_buf[0..avail_len].copy_from_slice(__input);
8925 Bytes::new(&payload_buf)
8926 } else {
8927 Bytes::new(__input)
8928 };
8929 let mut __struct = Self::default();
8930 __struct.gcs_system_id = buf.get_u8();
8931 __struct.control_request = buf.get_u8();
8932 __struct.ack = buf.get_u8();
8933 Ok(__struct)
8934 }
8935 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8936 let mut __tmp = BytesMut::new(bytes);
8937 #[allow(clippy::absurd_extreme_comparisons)]
8938 #[allow(unused_comparisons)]
8939 if __tmp.remaining() < Self::ENCODED_LEN {
8940 panic!(
8941 "buffer is too small (need {} bytes, but got {})",
8942 Self::ENCODED_LEN,
8943 __tmp.remaining(),
8944 )
8945 }
8946 __tmp.put_u8(self.gcs_system_id);
8947 __tmp.put_u8(self.control_request);
8948 __tmp.put_u8(self.ack);
8949 if matches!(version, MavlinkVersion::V2) {
8950 let len = __tmp.len();
8951 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8952 } else {
8953 __tmp.len()
8954 }
8955 }
8956}
8957#[doc = "id: 247"]
8958#[doc = "Information about a potential collision."]
8959#[derive(Debug, Clone, PartialEq)]
8960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8962pub struct COLLISION_DATA {
8963 #[doc = "Unique identifier, domain based on src field"]
8964 pub id: u32,
8965 #[doc = "Estimated time until collision occurs"]
8966 pub time_to_minimum_delta: f32,
8967 #[doc = "Closest vertical distance between vehicle and object"]
8968 pub altitude_minimum_delta: f32,
8969 #[doc = "Closest horizontal distance between vehicle and object"]
8970 pub horizontal_minimum_delta: f32,
8971 #[doc = "Collision data source"]
8972 pub src: MavCollisionSrc,
8973 #[doc = "Action that is being taken to avoid this collision"]
8974 pub action: MavCollisionAction,
8975 #[doc = "How concerned the aircraft is about this collision"]
8976 pub threat_level: MavCollisionThreatLevel,
8977}
8978impl COLLISION_DATA {
8979 pub const ENCODED_LEN: usize = 19usize;
8980 pub const DEFAULT: Self = Self {
8981 id: 0_u32,
8982 time_to_minimum_delta: 0.0_f32,
8983 altitude_minimum_delta: 0.0_f32,
8984 horizontal_minimum_delta: 0.0_f32,
8985 src: MavCollisionSrc::DEFAULT,
8986 action: MavCollisionAction::DEFAULT,
8987 threat_level: MavCollisionThreatLevel::DEFAULT,
8988 };
8989 #[cfg(feature = "arbitrary")]
8990 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8991 use arbitrary::{Arbitrary, Unstructured};
8992 let mut buf = [0u8; 1024];
8993 rng.fill_bytes(&mut buf);
8994 let mut unstructured = Unstructured::new(&buf);
8995 Self::arbitrary(&mut unstructured).unwrap_or_default()
8996 }
8997}
8998impl Default for COLLISION_DATA {
8999 fn default() -> Self {
9000 Self::DEFAULT.clone()
9001 }
9002}
9003impl MessageData for COLLISION_DATA {
9004 type Message = MavMessage;
9005 const ID: u32 = 247u32;
9006 const NAME: &'static str = "COLLISION";
9007 const EXTRA_CRC: u8 = 81u8;
9008 const ENCODED_LEN: usize = 19usize;
9009 fn deser(
9010 _version: MavlinkVersion,
9011 __input: &[u8],
9012 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9013 let avail_len = __input.len();
9014 let mut payload_buf = [0; Self::ENCODED_LEN];
9015 let mut buf = if avail_len < Self::ENCODED_LEN {
9016 payload_buf[0..avail_len].copy_from_slice(__input);
9017 Bytes::new(&payload_buf)
9018 } else {
9019 Bytes::new(__input)
9020 };
9021 let mut __struct = Self::default();
9022 __struct.id = buf.get_u32_le();
9023 __struct.time_to_minimum_delta = buf.get_f32_le();
9024 __struct.altitude_minimum_delta = buf.get_f32_le();
9025 __struct.horizontal_minimum_delta = buf.get_f32_le();
9026 let tmp = buf.get_u8();
9027 __struct.src =
9028 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9029 enum_type: "MavCollisionSrc",
9030 value: tmp as u32,
9031 })?;
9032 let tmp = buf.get_u8();
9033 __struct.action =
9034 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9035 enum_type: "MavCollisionAction",
9036 value: tmp as u32,
9037 })?;
9038 let tmp = buf.get_u8();
9039 __struct.threat_level =
9040 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9041 enum_type: "MavCollisionThreatLevel",
9042 value: tmp as u32,
9043 })?;
9044 Ok(__struct)
9045 }
9046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9047 let mut __tmp = BytesMut::new(bytes);
9048 #[allow(clippy::absurd_extreme_comparisons)]
9049 #[allow(unused_comparisons)]
9050 if __tmp.remaining() < Self::ENCODED_LEN {
9051 panic!(
9052 "buffer is too small (need {} bytes, but got {})",
9053 Self::ENCODED_LEN,
9054 __tmp.remaining(),
9055 )
9056 }
9057 __tmp.put_u32_le(self.id);
9058 __tmp.put_f32_le(self.time_to_minimum_delta);
9059 __tmp.put_f32_le(self.altitude_minimum_delta);
9060 __tmp.put_f32_le(self.horizontal_minimum_delta);
9061 __tmp.put_u8(self.src as u8);
9062 __tmp.put_u8(self.action as u8);
9063 __tmp.put_u8(self.threat_level as u8);
9064 if matches!(version, MavlinkVersion::V2) {
9065 let len = __tmp.len();
9066 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9067 } else {
9068 __tmp.len()
9069 }
9070 }
9071}
9072#[doc = "id: 77"]
9073#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9074#[derive(Debug, Clone, PartialEq)]
9075#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9076#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9077pub struct COMMAND_ACK_DATA {
9078 #[doc = "Command ID (of acknowledged command)."]
9079 pub command: MavCmd,
9080 #[doc = "Result of command."]
9081 pub result: MavResult,
9082 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9083 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9084 pub progress: u8,
9085 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9086 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9087 pub result_param2: i32,
9088 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9089 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9090 pub target_system: u8,
9091 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9092 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9093 pub target_component: u8,
9094}
9095impl COMMAND_ACK_DATA {
9096 pub const ENCODED_LEN: usize = 10usize;
9097 pub const DEFAULT: Self = Self {
9098 command: MavCmd::DEFAULT,
9099 result: MavResult::DEFAULT,
9100 progress: 0_u8,
9101 result_param2: 0_i32,
9102 target_system: 0_u8,
9103 target_component: 0_u8,
9104 };
9105 #[cfg(feature = "arbitrary")]
9106 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9107 use arbitrary::{Arbitrary, Unstructured};
9108 let mut buf = [0u8; 1024];
9109 rng.fill_bytes(&mut buf);
9110 let mut unstructured = Unstructured::new(&buf);
9111 Self::arbitrary(&mut unstructured).unwrap_or_default()
9112 }
9113}
9114impl Default for COMMAND_ACK_DATA {
9115 fn default() -> Self {
9116 Self::DEFAULT.clone()
9117 }
9118}
9119impl MessageData for COMMAND_ACK_DATA {
9120 type Message = MavMessage;
9121 const ID: u32 = 77u32;
9122 const NAME: &'static str = "COMMAND_ACK";
9123 const EXTRA_CRC: u8 = 143u8;
9124 const ENCODED_LEN: usize = 10usize;
9125 fn deser(
9126 _version: MavlinkVersion,
9127 __input: &[u8],
9128 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9129 let avail_len = __input.len();
9130 let mut payload_buf = [0; Self::ENCODED_LEN];
9131 let mut buf = if avail_len < Self::ENCODED_LEN {
9132 payload_buf[0..avail_len].copy_from_slice(__input);
9133 Bytes::new(&payload_buf)
9134 } else {
9135 Bytes::new(__input)
9136 };
9137 let mut __struct = Self::default();
9138 let tmp = buf.get_u16_le();
9139 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9140 ::mavlink_core::error::ParserError::InvalidEnum {
9141 enum_type: "MavCmd",
9142 value: tmp as u32,
9143 },
9144 )?;
9145 let tmp = buf.get_u8();
9146 __struct.result =
9147 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9148 enum_type: "MavResult",
9149 value: tmp as u32,
9150 })?;
9151 __struct.progress = buf.get_u8();
9152 __struct.result_param2 = buf.get_i32_le();
9153 __struct.target_system = buf.get_u8();
9154 __struct.target_component = buf.get_u8();
9155 Ok(__struct)
9156 }
9157 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9158 let mut __tmp = BytesMut::new(bytes);
9159 #[allow(clippy::absurd_extreme_comparisons)]
9160 #[allow(unused_comparisons)]
9161 if __tmp.remaining() < Self::ENCODED_LEN {
9162 panic!(
9163 "buffer is too small (need {} bytes, but got {})",
9164 Self::ENCODED_LEN,
9165 __tmp.remaining(),
9166 )
9167 }
9168 __tmp.put_u16_le(self.command as u16);
9169 __tmp.put_u8(self.result as u8);
9170 __tmp.put_u8(self.progress);
9171 __tmp.put_i32_le(self.result_param2);
9172 __tmp.put_u8(self.target_system);
9173 __tmp.put_u8(self.target_component);
9174 if matches!(version, MavlinkVersion::V2) {
9175 let len = __tmp.len();
9176 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9177 } else {
9178 __tmp.len()
9179 }
9180 }
9181}
9182#[doc = "id: 80"]
9183#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9184#[derive(Debug, Clone, PartialEq)]
9185#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9187pub struct COMMAND_CANCEL_DATA {
9188 #[doc = "Command ID (of command to cancel)."]
9189 pub command: MavCmd,
9190 #[doc = "System executing long running command. Should not be broadcast (0)."]
9191 pub target_system: u8,
9192 #[doc = "Component executing long running command."]
9193 pub target_component: u8,
9194}
9195impl COMMAND_CANCEL_DATA {
9196 pub const ENCODED_LEN: usize = 4usize;
9197 pub const DEFAULT: Self = Self {
9198 command: MavCmd::DEFAULT,
9199 target_system: 0_u8,
9200 target_component: 0_u8,
9201 };
9202 #[cfg(feature = "arbitrary")]
9203 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9204 use arbitrary::{Arbitrary, Unstructured};
9205 let mut buf = [0u8; 1024];
9206 rng.fill_bytes(&mut buf);
9207 let mut unstructured = Unstructured::new(&buf);
9208 Self::arbitrary(&mut unstructured).unwrap_or_default()
9209 }
9210}
9211impl Default for COMMAND_CANCEL_DATA {
9212 fn default() -> Self {
9213 Self::DEFAULT.clone()
9214 }
9215}
9216impl MessageData for COMMAND_CANCEL_DATA {
9217 type Message = MavMessage;
9218 const ID: u32 = 80u32;
9219 const NAME: &'static str = "COMMAND_CANCEL";
9220 const EXTRA_CRC: u8 = 14u8;
9221 const ENCODED_LEN: usize = 4usize;
9222 fn deser(
9223 _version: MavlinkVersion,
9224 __input: &[u8],
9225 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9226 let avail_len = __input.len();
9227 let mut payload_buf = [0; Self::ENCODED_LEN];
9228 let mut buf = if avail_len < Self::ENCODED_LEN {
9229 payload_buf[0..avail_len].copy_from_slice(__input);
9230 Bytes::new(&payload_buf)
9231 } else {
9232 Bytes::new(__input)
9233 };
9234 let mut __struct = Self::default();
9235 let tmp = buf.get_u16_le();
9236 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9237 ::mavlink_core::error::ParserError::InvalidEnum {
9238 enum_type: "MavCmd",
9239 value: tmp as u32,
9240 },
9241 )?;
9242 __struct.target_system = buf.get_u8();
9243 __struct.target_component = buf.get_u8();
9244 Ok(__struct)
9245 }
9246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9247 let mut __tmp = BytesMut::new(bytes);
9248 #[allow(clippy::absurd_extreme_comparisons)]
9249 #[allow(unused_comparisons)]
9250 if __tmp.remaining() < Self::ENCODED_LEN {
9251 panic!(
9252 "buffer is too small (need {} bytes, but got {})",
9253 Self::ENCODED_LEN,
9254 __tmp.remaining(),
9255 )
9256 }
9257 __tmp.put_u16_le(self.command as u16);
9258 __tmp.put_u8(self.target_system);
9259 __tmp.put_u8(self.target_component);
9260 if matches!(version, MavlinkVersion::V2) {
9261 let len = __tmp.len();
9262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9263 } else {
9264 __tmp.len()
9265 }
9266 }
9267}
9268#[doc = "id: 75"]
9269#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9270#[derive(Debug, Clone, PartialEq)]
9271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9273pub struct COMMAND_INT_DATA {
9274 #[doc = "PARAM1, see MAV_CMD enum"]
9275 pub param1: f32,
9276 #[doc = "PARAM2, see MAV_CMD enum"]
9277 pub param2: f32,
9278 #[doc = "PARAM3, see MAV_CMD enum"]
9279 pub param3: f32,
9280 #[doc = "PARAM4, see MAV_CMD enum"]
9281 pub param4: f32,
9282 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9283 pub x: i32,
9284 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9285 pub y: i32,
9286 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9287 pub z: f32,
9288 #[doc = "The scheduled action for the mission item."]
9289 pub command: MavCmd,
9290 #[doc = "System ID"]
9291 pub target_system: u8,
9292 #[doc = "Component ID"]
9293 pub target_component: u8,
9294 #[doc = "The coordinate system of the COMMAND."]
9295 pub frame: MavFrame,
9296 #[doc = "Not used."]
9297 pub current: u8,
9298 #[doc = "Not used (set 0)."]
9299 pub autocontinue: u8,
9300}
9301impl COMMAND_INT_DATA {
9302 pub const ENCODED_LEN: usize = 35usize;
9303 pub const DEFAULT: Self = Self {
9304 param1: 0.0_f32,
9305 param2: 0.0_f32,
9306 param3: 0.0_f32,
9307 param4: 0.0_f32,
9308 x: 0_i32,
9309 y: 0_i32,
9310 z: 0.0_f32,
9311 command: MavCmd::DEFAULT,
9312 target_system: 0_u8,
9313 target_component: 0_u8,
9314 frame: MavFrame::DEFAULT,
9315 current: 0_u8,
9316 autocontinue: 0_u8,
9317 };
9318 #[cfg(feature = "arbitrary")]
9319 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9320 use arbitrary::{Arbitrary, Unstructured};
9321 let mut buf = [0u8; 1024];
9322 rng.fill_bytes(&mut buf);
9323 let mut unstructured = Unstructured::new(&buf);
9324 Self::arbitrary(&mut unstructured).unwrap_or_default()
9325 }
9326}
9327impl Default for COMMAND_INT_DATA {
9328 fn default() -> Self {
9329 Self::DEFAULT.clone()
9330 }
9331}
9332impl MessageData for COMMAND_INT_DATA {
9333 type Message = MavMessage;
9334 const ID: u32 = 75u32;
9335 const NAME: &'static str = "COMMAND_INT";
9336 const EXTRA_CRC: u8 = 158u8;
9337 const ENCODED_LEN: usize = 35usize;
9338 fn deser(
9339 _version: MavlinkVersion,
9340 __input: &[u8],
9341 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9342 let avail_len = __input.len();
9343 let mut payload_buf = [0; Self::ENCODED_LEN];
9344 let mut buf = if avail_len < Self::ENCODED_LEN {
9345 payload_buf[0..avail_len].copy_from_slice(__input);
9346 Bytes::new(&payload_buf)
9347 } else {
9348 Bytes::new(__input)
9349 };
9350 let mut __struct = Self::default();
9351 __struct.param1 = buf.get_f32_le();
9352 __struct.param2 = buf.get_f32_le();
9353 __struct.param3 = buf.get_f32_le();
9354 __struct.param4 = buf.get_f32_le();
9355 __struct.x = buf.get_i32_le();
9356 __struct.y = buf.get_i32_le();
9357 __struct.z = buf.get_f32_le();
9358 let tmp = buf.get_u16_le();
9359 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9360 ::mavlink_core::error::ParserError::InvalidEnum {
9361 enum_type: "MavCmd",
9362 value: tmp as u32,
9363 },
9364 )?;
9365 __struct.target_system = buf.get_u8();
9366 __struct.target_component = buf.get_u8();
9367 let tmp = buf.get_u8();
9368 __struct.frame =
9369 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9370 enum_type: "MavFrame",
9371 value: tmp as u32,
9372 })?;
9373 __struct.current = buf.get_u8();
9374 __struct.autocontinue = buf.get_u8();
9375 Ok(__struct)
9376 }
9377 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9378 let mut __tmp = BytesMut::new(bytes);
9379 #[allow(clippy::absurd_extreme_comparisons)]
9380 #[allow(unused_comparisons)]
9381 if __tmp.remaining() < Self::ENCODED_LEN {
9382 panic!(
9383 "buffer is too small (need {} bytes, but got {})",
9384 Self::ENCODED_LEN,
9385 __tmp.remaining(),
9386 )
9387 }
9388 __tmp.put_f32_le(self.param1);
9389 __tmp.put_f32_le(self.param2);
9390 __tmp.put_f32_le(self.param3);
9391 __tmp.put_f32_le(self.param4);
9392 __tmp.put_i32_le(self.x);
9393 __tmp.put_i32_le(self.y);
9394 __tmp.put_f32_le(self.z);
9395 __tmp.put_u16_le(self.command as u16);
9396 __tmp.put_u8(self.target_system);
9397 __tmp.put_u8(self.target_component);
9398 __tmp.put_u8(self.frame as u8);
9399 __tmp.put_u8(self.current);
9400 __tmp.put_u8(self.autocontinue);
9401 if matches!(version, MavlinkVersion::V2) {
9402 let len = __tmp.len();
9403 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9404 } else {
9405 __tmp.len()
9406 }
9407 }
9408}
9409#[doc = "id: 223"]
9410#[doc = "Message encoding a command with parameters as scaled integers and additional metadata. Scaling depends on the actual command value."]
9411#[derive(Debug, Clone, PartialEq)]
9412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9413#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9414pub struct COMMAND_INT_STAMPED_DATA {
9415 #[doc = "Microseconds elapsed since vehicle boot"]
9416 pub vehicle_timestamp: u64,
9417 #[doc = "UTC time, seconds elapsed since 01.01.1970"]
9418 pub utc_time: u32,
9419 #[doc = "PARAM1, see MAV_CMD enum"]
9420 pub param1: f32,
9421 #[doc = "PARAM2, see MAV_CMD enum"]
9422 pub param2: f32,
9423 #[doc = "PARAM3, see MAV_CMD enum"]
9424 pub param3: f32,
9425 #[doc = "PARAM4, see MAV_CMD enum"]
9426 pub param4: f32,
9427 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9428 pub x: i32,
9429 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9430 pub y: i32,
9431 #[doc = "PARAM7 / z position: global: altitude in meters (MSL, WGS84, AGL or relative to home - depending on frame)."]
9432 pub z: f32,
9433 #[doc = "The scheduled action for the mission item, as defined by MAV_CMD enum"]
9434 pub command: MavCmd,
9435 #[doc = "System ID"]
9436 pub target_system: u8,
9437 #[doc = "Component ID"]
9438 pub target_component: u8,
9439 #[doc = "The coordinate system of the COMMAND, as defined by MAV_FRAME enum"]
9440 pub frame: MavFrame,
9441 #[doc = "false:0, true:1"]
9442 pub current: u8,
9443 #[doc = "autocontinue to next wp"]
9444 pub autocontinue: u8,
9445}
9446impl COMMAND_INT_STAMPED_DATA {
9447 pub const ENCODED_LEN: usize = 47usize;
9448 pub const DEFAULT: Self = Self {
9449 vehicle_timestamp: 0_u64,
9450 utc_time: 0_u32,
9451 param1: 0.0_f32,
9452 param2: 0.0_f32,
9453 param3: 0.0_f32,
9454 param4: 0.0_f32,
9455 x: 0_i32,
9456 y: 0_i32,
9457 z: 0.0_f32,
9458 command: MavCmd::DEFAULT,
9459 target_system: 0_u8,
9460 target_component: 0_u8,
9461 frame: MavFrame::DEFAULT,
9462 current: 0_u8,
9463 autocontinue: 0_u8,
9464 };
9465 #[cfg(feature = "arbitrary")]
9466 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9467 use arbitrary::{Arbitrary, Unstructured};
9468 let mut buf = [0u8; 1024];
9469 rng.fill_bytes(&mut buf);
9470 let mut unstructured = Unstructured::new(&buf);
9471 Self::arbitrary(&mut unstructured).unwrap_or_default()
9472 }
9473}
9474impl Default for COMMAND_INT_STAMPED_DATA {
9475 fn default() -> Self {
9476 Self::DEFAULT.clone()
9477 }
9478}
9479impl MessageData for COMMAND_INT_STAMPED_DATA {
9480 type Message = MavMessage;
9481 const ID: u32 = 223u32;
9482 const NAME: &'static str = "COMMAND_INT_STAMPED";
9483 const EXTRA_CRC: u8 = 119u8;
9484 const ENCODED_LEN: usize = 47usize;
9485 fn deser(
9486 _version: MavlinkVersion,
9487 __input: &[u8],
9488 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9489 let avail_len = __input.len();
9490 let mut payload_buf = [0; Self::ENCODED_LEN];
9491 let mut buf = if avail_len < Self::ENCODED_LEN {
9492 payload_buf[0..avail_len].copy_from_slice(__input);
9493 Bytes::new(&payload_buf)
9494 } else {
9495 Bytes::new(__input)
9496 };
9497 let mut __struct = Self::default();
9498 __struct.vehicle_timestamp = buf.get_u64_le();
9499 __struct.utc_time = buf.get_u32_le();
9500 __struct.param1 = buf.get_f32_le();
9501 __struct.param2 = buf.get_f32_le();
9502 __struct.param3 = buf.get_f32_le();
9503 __struct.param4 = buf.get_f32_le();
9504 __struct.x = buf.get_i32_le();
9505 __struct.y = buf.get_i32_le();
9506 __struct.z = buf.get_f32_le();
9507 let tmp = buf.get_u16_le();
9508 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9509 ::mavlink_core::error::ParserError::InvalidEnum {
9510 enum_type: "MavCmd",
9511 value: tmp as u32,
9512 },
9513 )?;
9514 __struct.target_system = buf.get_u8();
9515 __struct.target_component = buf.get_u8();
9516 let tmp = buf.get_u8();
9517 __struct.frame =
9518 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9519 enum_type: "MavFrame",
9520 value: tmp as u32,
9521 })?;
9522 __struct.current = buf.get_u8();
9523 __struct.autocontinue = buf.get_u8();
9524 Ok(__struct)
9525 }
9526 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9527 let mut __tmp = BytesMut::new(bytes);
9528 #[allow(clippy::absurd_extreme_comparisons)]
9529 #[allow(unused_comparisons)]
9530 if __tmp.remaining() < Self::ENCODED_LEN {
9531 panic!(
9532 "buffer is too small (need {} bytes, but got {})",
9533 Self::ENCODED_LEN,
9534 __tmp.remaining(),
9535 )
9536 }
9537 __tmp.put_u64_le(self.vehicle_timestamp);
9538 __tmp.put_u32_le(self.utc_time);
9539 __tmp.put_f32_le(self.param1);
9540 __tmp.put_f32_le(self.param2);
9541 __tmp.put_f32_le(self.param3);
9542 __tmp.put_f32_le(self.param4);
9543 __tmp.put_i32_le(self.x);
9544 __tmp.put_i32_le(self.y);
9545 __tmp.put_f32_le(self.z);
9546 __tmp.put_u16_le(self.command as u16);
9547 __tmp.put_u8(self.target_system);
9548 __tmp.put_u8(self.target_component);
9549 __tmp.put_u8(self.frame as u8);
9550 __tmp.put_u8(self.current);
9551 __tmp.put_u8(self.autocontinue);
9552 if matches!(version, MavlinkVersion::V2) {
9553 let len = __tmp.len();
9554 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9555 } else {
9556 __tmp.len()
9557 }
9558 }
9559}
9560#[doc = "id: 76"]
9561#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9562#[derive(Debug, Clone, PartialEq)]
9563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9565pub struct COMMAND_LONG_DATA {
9566 #[doc = "Parameter 1 (for the specific command)."]
9567 pub param1: f32,
9568 #[doc = "Parameter 2 (for the specific command)."]
9569 pub param2: f32,
9570 #[doc = "Parameter 3 (for the specific command)."]
9571 pub param3: f32,
9572 #[doc = "Parameter 4 (for the specific command)."]
9573 pub param4: f32,
9574 #[doc = "Parameter 5 (for the specific command)."]
9575 pub param5: f32,
9576 #[doc = "Parameter 6 (for the specific command)."]
9577 pub param6: f32,
9578 #[doc = "Parameter 7 (for the specific command)."]
9579 pub param7: f32,
9580 #[doc = "Command ID (of command to send)."]
9581 pub command: MavCmd,
9582 #[doc = "System which should execute the command"]
9583 pub target_system: u8,
9584 #[doc = "Component which should execute the command, 0 for all components"]
9585 pub target_component: u8,
9586 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9587 pub confirmation: u8,
9588}
9589impl COMMAND_LONG_DATA {
9590 pub const ENCODED_LEN: usize = 33usize;
9591 pub const DEFAULT: Self = Self {
9592 param1: 0.0_f32,
9593 param2: 0.0_f32,
9594 param3: 0.0_f32,
9595 param4: 0.0_f32,
9596 param5: 0.0_f32,
9597 param6: 0.0_f32,
9598 param7: 0.0_f32,
9599 command: MavCmd::DEFAULT,
9600 target_system: 0_u8,
9601 target_component: 0_u8,
9602 confirmation: 0_u8,
9603 };
9604 #[cfg(feature = "arbitrary")]
9605 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9606 use arbitrary::{Arbitrary, Unstructured};
9607 let mut buf = [0u8; 1024];
9608 rng.fill_bytes(&mut buf);
9609 let mut unstructured = Unstructured::new(&buf);
9610 Self::arbitrary(&mut unstructured).unwrap_or_default()
9611 }
9612}
9613impl Default for COMMAND_LONG_DATA {
9614 fn default() -> Self {
9615 Self::DEFAULT.clone()
9616 }
9617}
9618impl MessageData for COMMAND_LONG_DATA {
9619 type Message = MavMessage;
9620 const ID: u32 = 76u32;
9621 const NAME: &'static str = "COMMAND_LONG";
9622 const EXTRA_CRC: u8 = 152u8;
9623 const ENCODED_LEN: usize = 33usize;
9624 fn deser(
9625 _version: MavlinkVersion,
9626 __input: &[u8],
9627 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9628 let avail_len = __input.len();
9629 let mut payload_buf = [0; Self::ENCODED_LEN];
9630 let mut buf = if avail_len < Self::ENCODED_LEN {
9631 payload_buf[0..avail_len].copy_from_slice(__input);
9632 Bytes::new(&payload_buf)
9633 } else {
9634 Bytes::new(__input)
9635 };
9636 let mut __struct = Self::default();
9637 __struct.param1 = buf.get_f32_le();
9638 __struct.param2 = buf.get_f32_le();
9639 __struct.param3 = buf.get_f32_le();
9640 __struct.param4 = buf.get_f32_le();
9641 __struct.param5 = buf.get_f32_le();
9642 __struct.param6 = buf.get_f32_le();
9643 __struct.param7 = buf.get_f32_le();
9644 let tmp = buf.get_u16_le();
9645 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9646 ::mavlink_core::error::ParserError::InvalidEnum {
9647 enum_type: "MavCmd",
9648 value: tmp as u32,
9649 },
9650 )?;
9651 __struct.target_system = buf.get_u8();
9652 __struct.target_component = buf.get_u8();
9653 __struct.confirmation = buf.get_u8();
9654 Ok(__struct)
9655 }
9656 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9657 let mut __tmp = BytesMut::new(bytes);
9658 #[allow(clippy::absurd_extreme_comparisons)]
9659 #[allow(unused_comparisons)]
9660 if __tmp.remaining() < Self::ENCODED_LEN {
9661 panic!(
9662 "buffer is too small (need {} bytes, but got {})",
9663 Self::ENCODED_LEN,
9664 __tmp.remaining(),
9665 )
9666 }
9667 __tmp.put_f32_le(self.param1);
9668 __tmp.put_f32_le(self.param2);
9669 __tmp.put_f32_le(self.param3);
9670 __tmp.put_f32_le(self.param4);
9671 __tmp.put_f32_le(self.param5);
9672 __tmp.put_f32_le(self.param6);
9673 __tmp.put_f32_le(self.param7);
9674 __tmp.put_u16_le(self.command as u16);
9675 __tmp.put_u8(self.target_system);
9676 __tmp.put_u8(self.target_component);
9677 __tmp.put_u8(self.confirmation);
9678 if matches!(version, MavlinkVersion::V2) {
9679 let len = __tmp.len();
9680 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9681 } else {
9682 __tmp.len()
9683 }
9684 }
9685}
9686#[doc = "id: 224"]
9687#[doc = "Send a command with up to seven parameters to the MAV and additional metadata."]
9688#[derive(Debug, Clone, PartialEq)]
9689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9691pub struct COMMAND_LONG_STAMPED_DATA {
9692 #[doc = "Microseconds elapsed since vehicle boot"]
9693 pub vehicle_timestamp: u64,
9694 #[doc = "UTC time, seconds elapsed since 01.01.1970"]
9695 pub utc_time: u32,
9696 #[doc = "Parameter 1, as defined by MAV_CMD enum."]
9697 pub param1: f32,
9698 #[doc = "Parameter 2, as defined by MAV_CMD enum."]
9699 pub param2: f32,
9700 #[doc = "Parameter 3, as defined by MAV_CMD enum."]
9701 pub param3: f32,
9702 #[doc = "Parameter 4, as defined by MAV_CMD enum."]
9703 pub param4: f32,
9704 #[doc = "Parameter 5, as defined by MAV_CMD enum."]
9705 pub param5: f32,
9706 #[doc = "Parameter 6, as defined by MAV_CMD enum."]
9707 pub param6: f32,
9708 #[doc = "Parameter 7, as defined by MAV_CMD enum."]
9709 pub param7: f32,
9710 #[doc = "Command ID, as defined by MAV_CMD enum."]
9711 pub command: MavCmd,
9712 #[doc = "System which should execute the command"]
9713 pub target_system: u8,
9714 #[doc = "Component which should execute the command, 0 for all components"]
9715 pub target_component: u8,
9716 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9717 pub confirmation: u8,
9718}
9719impl COMMAND_LONG_STAMPED_DATA {
9720 pub const ENCODED_LEN: usize = 45usize;
9721 pub const DEFAULT: Self = Self {
9722 vehicle_timestamp: 0_u64,
9723 utc_time: 0_u32,
9724 param1: 0.0_f32,
9725 param2: 0.0_f32,
9726 param3: 0.0_f32,
9727 param4: 0.0_f32,
9728 param5: 0.0_f32,
9729 param6: 0.0_f32,
9730 param7: 0.0_f32,
9731 command: MavCmd::DEFAULT,
9732 target_system: 0_u8,
9733 target_component: 0_u8,
9734 confirmation: 0_u8,
9735 };
9736 #[cfg(feature = "arbitrary")]
9737 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9738 use arbitrary::{Arbitrary, Unstructured};
9739 let mut buf = [0u8; 1024];
9740 rng.fill_bytes(&mut buf);
9741 let mut unstructured = Unstructured::new(&buf);
9742 Self::arbitrary(&mut unstructured).unwrap_or_default()
9743 }
9744}
9745impl Default for COMMAND_LONG_STAMPED_DATA {
9746 fn default() -> Self {
9747 Self::DEFAULT.clone()
9748 }
9749}
9750impl MessageData for COMMAND_LONG_STAMPED_DATA {
9751 type Message = MavMessage;
9752 const ID: u32 = 224u32;
9753 const NAME: &'static str = "COMMAND_LONG_STAMPED";
9754 const EXTRA_CRC: u8 = 102u8;
9755 const ENCODED_LEN: usize = 45usize;
9756 fn deser(
9757 _version: MavlinkVersion,
9758 __input: &[u8],
9759 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9760 let avail_len = __input.len();
9761 let mut payload_buf = [0; Self::ENCODED_LEN];
9762 let mut buf = if avail_len < Self::ENCODED_LEN {
9763 payload_buf[0..avail_len].copy_from_slice(__input);
9764 Bytes::new(&payload_buf)
9765 } else {
9766 Bytes::new(__input)
9767 };
9768 let mut __struct = Self::default();
9769 __struct.vehicle_timestamp = buf.get_u64_le();
9770 __struct.utc_time = buf.get_u32_le();
9771 __struct.param1 = buf.get_f32_le();
9772 __struct.param2 = buf.get_f32_le();
9773 __struct.param3 = buf.get_f32_le();
9774 __struct.param4 = buf.get_f32_le();
9775 __struct.param5 = buf.get_f32_le();
9776 __struct.param6 = buf.get_f32_le();
9777 __struct.param7 = buf.get_f32_le();
9778 let tmp = buf.get_u16_le();
9779 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9780 ::mavlink_core::error::ParserError::InvalidEnum {
9781 enum_type: "MavCmd",
9782 value: tmp as u32,
9783 },
9784 )?;
9785 __struct.target_system = buf.get_u8();
9786 __struct.target_component = buf.get_u8();
9787 __struct.confirmation = buf.get_u8();
9788 Ok(__struct)
9789 }
9790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9791 let mut __tmp = BytesMut::new(bytes);
9792 #[allow(clippy::absurd_extreme_comparisons)]
9793 #[allow(unused_comparisons)]
9794 if __tmp.remaining() < Self::ENCODED_LEN {
9795 panic!(
9796 "buffer is too small (need {} bytes, but got {})",
9797 Self::ENCODED_LEN,
9798 __tmp.remaining(),
9799 )
9800 }
9801 __tmp.put_u64_le(self.vehicle_timestamp);
9802 __tmp.put_u32_le(self.utc_time);
9803 __tmp.put_f32_le(self.param1);
9804 __tmp.put_f32_le(self.param2);
9805 __tmp.put_f32_le(self.param3);
9806 __tmp.put_f32_le(self.param4);
9807 __tmp.put_f32_le(self.param5);
9808 __tmp.put_f32_le(self.param6);
9809 __tmp.put_f32_le(self.param7);
9810 __tmp.put_u16_le(self.command as u16);
9811 __tmp.put_u8(self.target_system);
9812 __tmp.put_u8(self.target_component);
9813 __tmp.put_u8(self.confirmation);
9814 if matches!(version, MavlinkVersion::V2) {
9815 let len = __tmp.len();
9816 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9817 } else {
9818 __tmp.len()
9819 }
9820 }
9821}
9822#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9823#[doc = "id: 395"]
9824#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9825#[derive(Debug, Clone, PartialEq)]
9826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9828pub struct COMPONENT_INFORMATION_DATA {
9829 #[doc = "Timestamp (time since system boot)."]
9830 pub time_boot_ms: u32,
9831 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9832 pub general_metadata_file_crc: u32,
9833 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9834 pub peripherals_metadata_file_crc: u32,
9835 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9836 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9837 pub general_metadata_uri: [u8; 100],
9838 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9839 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9840 pub peripherals_metadata_uri: [u8; 100],
9841}
9842impl COMPONENT_INFORMATION_DATA {
9843 pub const ENCODED_LEN: usize = 212usize;
9844 pub const DEFAULT: Self = Self {
9845 time_boot_ms: 0_u32,
9846 general_metadata_file_crc: 0_u32,
9847 peripherals_metadata_file_crc: 0_u32,
9848 general_metadata_uri: [0_u8; 100usize],
9849 peripherals_metadata_uri: [0_u8; 100usize],
9850 };
9851 #[cfg(feature = "arbitrary")]
9852 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9853 use arbitrary::{Arbitrary, Unstructured};
9854 let mut buf = [0u8; 1024];
9855 rng.fill_bytes(&mut buf);
9856 let mut unstructured = Unstructured::new(&buf);
9857 Self::arbitrary(&mut unstructured).unwrap_or_default()
9858 }
9859}
9860impl Default for COMPONENT_INFORMATION_DATA {
9861 fn default() -> Self {
9862 Self::DEFAULT.clone()
9863 }
9864}
9865impl MessageData for COMPONENT_INFORMATION_DATA {
9866 type Message = MavMessage;
9867 const ID: u32 = 395u32;
9868 const NAME: &'static str = "COMPONENT_INFORMATION";
9869 const EXTRA_CRC: u8 = 0u8;
9870 const ENCODED_LEN: usize = 212usize;
9871 fn deser(
9872 _version: MavlinkVersion,
9873 __input: &[u8],
9874 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9875 let avail_len = __input.len();
9876 let mut payload_buf = [0; Self::ENCODED_LEN];
9877 let mut buf = if avail_len < Self::ENCODED_LEN {
9878 payload_buf[0..avail_len].copy_from_slice(__input);
9879 Bytes::new(&payload_buf)
9880 } else {
9881 Bytes::new(__input)
9882 };
9883 let mut __struct = Self::default();
9884 __struct.time_boot_ms = buf.get_u32_le();
9885 __struct.general_metadata_file_crc = buf.get_u32_le();
9886 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9887 for v in &mut __struct.general_metadata_uri {
9888 let val = buf.get_u8();
9889 *v = val;
9890 }
9891 for v in &mut __struct.peripherals_metadata_uri {
9892 let val = buf.get_u8();
9893 *v = val;
9894 }
9895 Ok(__struct)
9896 }
9897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9898 let mut __tmp = BytesMut::new(bytes);
9899 #[allow(clippy::absurd_extreme_comparisons)]
9900 #[allow(unused_comparisons)]
9901 if __tmp.remaining() < Self::ENCODED_LEN {
9902 panic!(
9903 "buffer is too small (need {} bytes, but got {})",
9904 Self::ENCODED_LEN,
9905 __tmp.remaining(),
9906 )
9907 }
9908 __tmp.put_u32_le(self.time_boot_ms);
9909 __tmp.put_u32_le(self.general_metadata_file_crc);
9910 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9911 for val in &self.general_metadata_uri {
9912 __tmp.put_u8(*val);
9913 }
9914 for val in &self.peripherals_metadata_uri {
9915 __tmp.put_u8(*val);
9916 }
9917 if matches!(version, MavlinkVersion::V2) {
9918 let len = __tmp.len();
9919 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9920 } else {
9921 __tmp.len()
9922 }
9923 }
9924}
9925#[doc = "id: 396"]
9926#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9927#[derive(Debug, Clone, PartialEq)]
9928#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9929#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9930pub struct COMPONENT_INFORMATION_BASIC_DATA {
9931 #[doc = "Component capability flags"]
9932 pub capabilities: MavProtocolCapability,
9933 #[doc = "Timestamp (time since system boot)."]
9934 pub time_boot_ms: u32,
9935 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9936 pub time_manufacture_s: u32,
9937 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9938 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9939 pub vendor_name: [u8; 32],
9940 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9941 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9942 pub model_name: [u8; 32],
9943 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9944 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9945 pub software_version: [u8; 24],
9946 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9947 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9948 pub hardware_version: [u8; 24],
9949 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9950 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9951 pub serial_number: [u8; 32],
9952}
9953impl COMPONENT_INFORMATION_BASIC_DATA {
9954 pub const ENCODED_LEN: usize = 160usize;
9955 pub const DEFAULT: Self = Self {
9956 capabilities: MavProtocolCapability::DEFAULT,
9957 time_boot_ms: 0_u32,
9958 time_manufacture_s: 0_u32,
9959 vendor_name: [0_u8; 32usize],
9960 model_name: [0_u8; 32usize],
9961 software_version: [0_u8; 24usize],
9962 hardware_version: [0_u8; 24usize],
9963 serial_number: [0_u8; 32usize],
9964 };
9965 #[cfg(feature = "arbitrary")]
9966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9967 use arbitrary::{Arbitrary, Unstructured};
9968 let mut buf = [0u8; 1024];
9969 rng.fill_bytes(&mut buf);
9970 let mut unstructured = Unstructured::new(&buf);
9971 Self::arbitrary(&mut unstructured).unwrap_or_default()
9972 }
9973}
9974impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9975 fn default() -> Self {
9976 Self::DEFAULT.clone()
9977 }
9978}
9979impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9980 type Message = MavMessage;
9981 const ID: u32 = 396u32;
9982 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9983 const EXTRA_CRC: u8 = 50u8;
9984 const ENCODED_LEN: usize = 160usize;
9985 fn deser(
9986 _version: MavlinkVersion,
9987 __input: &[u8],
9988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9989 let avail_len = __input.len();
9990 let mut payload_buf = [0; Self::ENCODED_LEN];
9991 let mut buf = if avail_len < Self::ENCODED_LEN {
9992 payload_buf[0..avail_len].copy_from_slice(__input);
9993 Bytes::new(&payload_buf)
9994 } else {
9995 Bytes::new(__input)
9996 };
9997 let mut __struct = Self::default();
9998 let tmp = buf.get_u64_le();
9999 __struct.capabilities = MavProtocolCapability::from_bits(
10000 tmp & MavProtocolCapability::all().bits(),
10001 )
10002 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10003 flag_type: "MavProtocolCapability",
10004 value: tmp as u32,
10005 })?;
10006 __struct.time_boot_ms = buf.get_u32_le();
10007 __struct.time_manufacture_s = buf.get_u32_le();
10008 for v in &mut __struct.vendor_name {
10009 let val = buf.get_u8();
10010 *v = val;
10011 }
10012 for v in &mut __struct.model_name {
10013 let val = buf.get_u8();
10014 *v = val;
10015 }
10016 for v in &mut __struct.software_version {
10017 let val = buf.get_u8();
10018 *v = val;
10019 }
10020 for v in &mut __struct.hardware_version {
10021 let val = buf.get_u8();
10022 *v = val;
10023 }
10024 for v in &mut __struct.serial_number {
10025 let val = buf.get_u8();
10026 *v = val;
10027 }
10028 Ok(__struct)
10029 }
10030 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10031 let mut __tmp = BytesMut::new(bytes);
10032 #[allow(clippy::absurd_extreme_comparisons)]
10033 #[allow(unused_comparisons)]
10034 if __tmp.remaining() < Self::ENCODED_LEN {
10035 panic!(
10036 "buffer is too small (need {} bytes, but got {})",
10037 Self::ENCODED_LEN,
10038 __tmp.remaining(),
10039 )
10040 }
10041 __tmp.put_u64_le(self.capabilities.bits());
10042 __tmp.put_u32_le(self.time_boot_ms);
10043 __tmp.put_u32_le(self.time_manufacture_s);
10044 for val in &self.vendor_name {
10045 __tmp.put_u8(*val);
10046 }
10047 for val in &self.model_name {
10048 __tmp.put_u8(*val);
10049 }
10050 for val in &self.software_version {
10051 __tmp.put_u8(*val);
10052 }
10053 for val in &self.hardware_version {
10054 __tmp.put_u8(*val);
10055 }
10056 for val in &self.serial_number {
10057 __tmp.put_u8(*val);
10058 }
10059 if matches!(version, MavlinkVersion::V2) {
10060 let len = __tmp.len();
10061 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10062 } else {
10063 __tmp.len()
10064 }
10065 }
10066}
10067#[doc = "id: 397"]
10068#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
10069#[derive(Debug, Clone, PartialEq)]
10070#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10071#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10072pub struct COMPONENT_METADATA_DATA {
10073 #[doc = "Timestamp (time since system boot)."]
10074 pub time_boot_ms: u32,
10075 #[doc = "CRC32 of the general metadata file."]
10076 pub file_crc: u32,
10077 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
10078 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10079 pub uri: [u8; 100],
10080}
10081impl COMPONENT_METADATA_DATA {
10082 pub const ENCODED_LEN: usize = 108usize;
10083 pub const DEFAULT: Self = Self {
10084 time_boot_ms: 0_u32,
10085 file_crc: 0_u32,
10086 uri: [0_u8; 100usize],
10087 };
10088 #[cfg(feature = "arbitrary")]
10089 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10090 use arbitrary::{Arbitrary, Unstructured};
10091 let mut buf = [0u8; 1024];
10092 rng.fill_bytes(&mut buf);
10093 let mut unstructured = Unstructured::new(&buf);
10094 Self::arbitrary(&mut unstructured).unwrap_or_default()
10095 }
10096}
10097impl Default for COMPONENT_METADATA_DATA {
10098 fn default() -> Self {
10099 Self::DEFAULT.clone()
10100 }
10101}
10102impl MessageData for COMPONENT_METADATA_DATA {
10103 type Message = MavMessage;
10104 const ID: u32 = 397u32;
10105 const NAME: &'static str = "COMPONENT_METADATA";
10106 const EXTRA_CRC: u8 = 182u8;
10107 const ENCODED_LEN: usize = 108usize;
10108 fn deser(
10109 _version: MavlinkVersion,
10110 __input: &[u8],
10111 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10112 let avail_len = __input.len();
10113 let mut payload_buf = [0; Self::ENCODED_LEN];
10114 let mut buf = if avail_len < Self::ENCODED_LEN {
10115 payload_buf[0..avail_len].copy_from_slice(__input);
10116 Bytes::new(&payload_buf)
10117 } else {
10118 Bytes::new(__input)
10119 };
10120 let mut __struct = Self::default();
10121 __struct.time_boot_ms = buf.get_u32_le();
10122 __struct.file_crc = buf.get_u32_le();
10123 for v in &mut __struct.uri {
10124 let val = buf.get_u8();
10125 *v = val;
10126 }
10127 Ok(__struct)
10128 }
10129 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10130 let mut __tmp = BytesMut::new(bytes);
10131 #[allow(clippy::absurd_extreme_comparisons)]
10132 #[allow(unused_comparisons)]
10133 if __tmp.remaining() < Self::ENCODED_LEN {
10134 panic!(
10135 "buffer is too small (need {} bytes, but got {})",
10136 Self::ENCODED_LEN,
10137 __tmp.remaining(),
10138 )
10139 }
10140 __tmp.put_u32_le(self.time_boot_ms);
10141 __tmp.put_u32_le(self.file_crc);
10142 for val in &self.uri {
10143 __tmp.put_u8(*val);
10144 }
10145 if matches!(version, MavlinkVersion::V2) {
10146 let len = __tmp.len();
10147 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10148 } else {
10149 __tmp.len()
10150 }
10151 }
10152}
10153#[doc = "id: 146"]
10154#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
10155#[derive(Debug, Clone, PartialEq)]
10156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10158pub struct CONTROL_SYSTEM_STATE_DATA {
10159 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10160 pub time_usec: u64,
10161 #[doc = "X acceleration in body frame"]
10162 pub x_acc: f32,
10163 #[doc = "Y acceleration in body frame"]
10164 pub y_acc: f32,
10165 #[doc = "Z acceleration in body frame"]
10166 pub z_acc: f32,
10167 #[doc = "X velocity in body frame"]
10168 pub x_vel: f32,
10169 #[doc = "Y velocity in body frame"]
10170 pub y_vel: f32,
10171 #[doc = "Z velocity in body frame"]
10172 pub z_vel: f32,
10173 #[doc = "X position in local frame"]
10174 pub x_pos: f32,
10175 #[doc = "Y position in local frame"]
10176 pub y_pos: f32,
10177 #[doc = "Z position in local frame"]
10178 pub z_pos: f32,
10179 #[doc = "Airspeed, set to -1 if unknown"]
10180 pub airspeed: f32,
10181 #[doc = "Variance of body velocity estimate"]
10182 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10183 pub vel_variance: [f32; 3],
10184 #[doc = "Variance in local position"]
10185 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10186 pub pos_variance: [f32; 3],
10187 #[doc = "The attitude, represented as Quaternion"]
10188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10189 pub q: [f32; 4],
10190 #[doc = "Angular rate in roll axis"]
10191 pub roll_rate: f32,
10192 #[doc = "Angular rate in pitch axis"]
10193 pub pitch_rate: f32,
10194 #[doc = "Angular rate in yaw axis"]
10195 pub yaw_rate: f32,
10196}
10197impl CONTROL_SYSTEM_STATE_DATA {
10198 pub const ENCODED_LEN: usize = 100usize;
10199 pub const DEFAULT: Self = Self {
10200 time_usec: 0_u64,
10201 x_acc: 0.0_f32,
10202 y_acc: 0.0_f32,
10203 z_acc: 0.0_f32,
10204 x_vel: 0.0_f32,
10205 y_vel: 0.0_f32,
10206 z_vel: 0.0_f32,
10207 x_pos: 0.0_f32,
10208 y_pos: 0.0_f32,
10209 z_pos: 0.0_f32,
10210 airspeed: 0.0_f32,
10211 vel_variance: [0.0_f32; 3usize],
10212 pos_variance: [0.0_f32; 3usize],
10213 q: [0.0_f32; 4usize],
10214 roll_rate: 0.0_f32,
10215 pitch_rate: 0.0_f32,
10216 yaw_rate: 0.0_f32,
10217 };
10218 #[cfg(feature = "arbitrary")]
10219 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10220 use arbitrary::{Arbitrary, Unstructured};
10221 let mut buf = [0u8; 1024];
10222 rng.fill_bytes(&mut buf);
10223 let mut unstructured = Unstructured::new(&buf);
10224 Self::arbitrary(&mut unstructured).unwrap_or_default()
10225 }
10226}
10227impl Default for CONTROL_SYSTEM_STATE_DATA {
10228 fn default() -> Self {
10229 Self::DEFAULT.clone()
10230 }
10231}
10232impl MessageData for CONTROL_SYSTEM_STATE_DATA {
10233 type Message = MavMessage;
10234 const ID: u32 = 146u32;
10235 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
10236 const EXTRA_CRC: u8 = 103u8;
10237 const ENCODED_LEN: usize = 100usize;
10238 fn deser(
10239 _version: MavlinkVersion,
10240 __input: &[u8],
10241 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10242 let avail_len = __input.len();
10243 let mut payload_buf = [0; Self::ENCODED_LEN];
10244 let mut buf = if avail_len < Self::ENCODED_LEN {
10245 payload_buf[0..avail_len].copy_from_slice(__input);
10246 Bytes::new(&payload_buf)
10247 } else {
10248 Bytes::new(__input)
10249 };
10250 let mut __struct = Self::default();
10251 __struct.time_usec = buf.get_u64_le();
10252 __struct.x_acc = buf.get_f32_le();
10253 __struct.y_acc = buf.get_f32_le();
10254 __struct.z_acc = buf.get_f32_le();
10255 __struct.x_vel = buf.get_f32_le();
10256 __struct.y_vel = buf.get_f32_le();
10257 __struct.z_vel = buf.get_f32_le();
10258 __struct.x_pos = buf.get_f32_le();
10259 __struct.y_pos = buf.get_f32_le();
10260 __struct.z_pos = buf.get_f32_le();
10261 __struct.airspeed = buf.get_f32_le();
10262 for v in &mut __struct.vel_variance {
10263 let val = buf.get_f32_le();
10264 *v = val;
10265 }
10266 for v in &mut __struct.pos_variance {
10267 let val = buf.get_f32_le();
10268 *v = val;
10269 }
10270 for v in &mut __struct.q {
10271 let val = buf.get_f32_le();
10272 *v = val;
10273 }
10274 __struct.roll_rate = buf.get_f32_le();
10275 __struct.pitch_rate = buf.get_f32_le();
10276 __struct.yaw_rate = buf.get_f32_le();
10277 Ok(__struct)
10278 }
10279 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10280 let mut __tmp = BytesMut::new(bytes);
10281 #[allow(clippy::absurd_extreme_comparisons)]
10282 #[allow(unused_comparisons)]
10283 if __tmp.remaining() < Self::ENCODED_LEN {
10284 panic!(
10285 "buffer is too small (need {} bytes, but got {})",
10286 Self::ENCODED_LEN,
10287 __tmp.remaining(),
10288 )
10289 }
10290 __tmp.put_u64_le(self.time_usec);
10291 __tmp.put_f32_le(self.x_acc);
10292 __tmp.put_f32_le(self.y_acc);
10293 __tmp.put_f32_le(self.z_acc);
10294 __tmp.put_f32_le(self.x_vel);
10295 __tmp.put_f32_le(self.y_vel);
10296 __tmp.put_f32_le(self.z_vel);
10297 __tmp.put_f32_le(self.x_pos);
10298 __tmp.put_f32_le(self.y_pos);
10299 __tmp.put_f32_le(self.z_pos);
10300 __tmp.put_f32_le(self.airspeed);
10301 for val in &self.vel_variance {
10302 __tmp.put_f32_le(*val);
10303 }
10304 for val in &self.pos_variance {
10305 __tmp.put_f32_le(*val);
10306 }
10307 for val in &self.q {
10308 __tmp.put_f32_le(*val);
10309 }
10310 __tmp.put_f32_le(self.roll_rate);
10311 __tmp.put_f32_le(self.pitch_rate);
10312 __tmp.put_f32_le(self.yaw_rate);
10313 if matches!(version, MavlinkVersion::V2) {
10314 let len = __tmp.len();
10315 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10316 } else {
10317 __tmp.len()
10318 }
10319 }
10320}
10321#[doc = "id: 411"]
10322#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10323#[derive(Debug, Clone, PartialEq)]
10324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10326pub struct CURRENT_EVENT_SEQUENCE_DATA {
10327 #[doc = "Sequence number."]
10328 pub sequence: u16,
10329 #[doc = "Flag bitset."]
10330 pub flags: MavEventCurrentSequenceFlags,
10331}
10332impl CURRENT_EVENT_SEQUENCE_DATA {
10333 pub const ENCODED_LEN: usize = 3usize;
10334 pub const DEFAULT: Self = Self {
10335 sequence: 0_u16,
10336 flags: MavEventCurrentSequenceFlags::DEFAULT,
10337 };
10338 #[cfg(feature = "arbitrary")]
10339 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10340 use arbitrary::{Arbitrary, Unstructured};
10341 let mut buf = [0u8; 1024];
10342 rng.fill_bytes(&mut buf);
10343 let mut unstructured = Unstructured::new(&buf);
10344 Self::arbitrary(&mut unstructured).unwrap_or_default()
10345 }
10346}
10347impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10348 fn default() -> Self {
10349 Self::DEFAULT.clone()
10350 }
10351}
10352impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10353 type Message = MavMessage;
10354 const ID: u32 = 411u32;
10355 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10356 const EXTRA_CRC: u8 = 106u8;
10357 const ENCODED_LEN: usize = 3usize;
10358 fn deser(
10359 _version: MavlinkVersion,
10360 __input: &[u8],
10361 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10362 let avail_len = __input.len();
10363 let mut payload_buf = [0; Self::ENCODED_LEN];
10364 let mut buf = if avail_len < Self::ENCODED_LEN {
10365 payload_buf[0..avail_len].copy_from_slice(__input);
10366 Bytes::new(&payload_buf)
10367 } else {
10368 Bytes::new(__input)
10369 };
10370 let mut __struct = Self::default();
10371 __struct.sequence = buf.get_u16_le();
10372 let tmp = buf.get_u8();
10373 __struct.flags =
10374 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10375 enum_type: "MavEventCurrentSequenceFlags",
10376 value: tmp as u32,
10377 })?;
10378 Ok(__struct)
10379 }
10380 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10381 let mut __tmp = BytesMut::new(bytes);
10382 #[allow(clippy::absurd_extreme_comparisons)]
10383 #[allow(unused_comparisons)]
10384 if __tmp.remaining() < Self::ENCODED_LEN {
10385 panic!(
10386 "buffer is too small (need {} bytes, but got {})",
10387 Self::ENCODED_LEN,
10388 __tmp.remaining(),
10389 )
10390 }
10391 __tmp.put_u16_le(self.sequence);
10392 __tmp.put_u8(self.flags as u8);
10393 if matches!(version, MavlinkVersion::V2) {
10394 let len = __tmp.len();
10395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10396 } else {
10397 __tmp.len()
10398 }
10399 }
10400}
10401#[doc = "id: 436"]
10402#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10403#[derive(Debug, Clone, PartialEq)]
10404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10406pub struct CURRENT_MODE_DATA {
10407 #[doc = "A bitfield for use for autopilot-specific flags"]
10408 pub custom_mode: u32,
10409 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10410 pub intended_custom_mode: u32,
10411 #[doc = "Standard mode."]
10412 pub standard_mode: MavStandardMode,
10413}
10414impl CURRENT_MODE_DATA {
10415 pub const ENCODED_LEN: usize = 9usize;
10416 pub const DEFAULT: Self = Self {
10417 custom_mode: 0_u32,
10418 intended_custom_mode: 0_u32,
10419 standard_mode: MavStandardMode::DEFAULT,
10420 };
10421 #[cfg(feature = "arbitrary")]
10422 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10423 use arbitrary::{Arbitrary, Unstructured};
10424 let mut buf = [0u8; 1024];
10425 rng.fill_bytes(&mut buf);
10426 let mut unstructured = Unstructured::new(&buf);
10427 Self::arbitrary(&mut unstructured).unwrap_or_default()
10428 }
10429}
10430impl Default for CURRENT_MODE_DATA {
10431 fn default() -> Self {
10432 Self::DEFAULT.clone()
10433 }
10434}
10435impl MessageData for CURRENT_MODE_DATA {
10436 type Message = MavMessage;
10437 const ID: u32 = 436u32;
10438 const NAME: &'static str = "CURRENT_MODE";
10439 const EXTRA_CRC: u8 = 193u8;
10440 const ENCODED_LEN: usize = 9usize;
10441 fn deser(
10442 _version: MavlinkVersion,
10443 __input: &[u8],
10444 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10445 let avail_len = __input.len();
10446 let mut payload_buf = [0; Self::ENCODED_LEN];
10447 let mut buf = if avail_len < Self::ENCODED_LEN {
10448 payload_buf[0..avail_len].copy_from_slice(__input);
10449 Bytes::new(&payload_buf)
10450 } else {
10451 Bytes::new(__input)
10452 };
10453 let mut __struct = Self::default();
10454 __struct.custom_mode = buf.get_u32_le();
10455 __struct.intended_custom_mode = buf.get_u32_le();
10456 let tmp = buf.get_u8();
10457 __struct.standard_mode =
10458 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10459 enum_type: "MavStandardMode",
10460 value: tmp as u32,
10461 })?;
10462 Ok(__struct)
10463 }
10464 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10465 let mut __tmp = BytesMut::new(bytes);
10466 #[allow(clippy::absurd_extreme_comparisons)]
10467 #[allow(unused_comparisons)]
10468 if __tmp.remaining() < Self::ENCODED_LEN {
10469 panic!(
10470 "buffer is too small (need {} bytes, but got {})",
10471 Self::ENCODED_LEN,
10472 __tmp.remaining(),
10473 )
10474 }
10475 __tmp.put_u32_le(self.custom_mode);
10476 __tmp.put_u32_le(self.intended_custom_mode);
10477 __tmp.put_u8(self.standard_mode as u8);
10478 if matches!(version, MavlinkVersion::V2) {
10479 let len = __tmp.len();
10480 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10481 } else {
10482 __tmp.len()
10483 }
10484 }
10485}
10486#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10487#[doc = "id: 67"]
10488#[doc = "Data stream status information."]
10489#[derive(Debug, Clone, PartialEq)]
10490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10492pub struct DATA_STREAM_DATA {
10493 #[doc = "The message rate"]
10494 pub message_rate: u16,
10495 #[doc = "The ID of the requested data stream"]
10496 pub stream_id: u8,
10497 #[doc = "1 stream is enabled, 0 stream is stopped."]
10498 pub on_off: u8,
10499}
10500impl DATA_STREAM_DATA {
10501 pub const ENCODED_LEN: usize = 4usize;
10502 pub const DEFAULT: Self = Self {
10503 message_rate: 0_u16,
10504 stream_id: 0_u8,
10505 on_off: 0_u8,
10506 };
10507 #[cfg(feature = "arbitrary")]
10508 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10509 use arbitrary::{Arbitrary, Unstructured};
10510 let mut buf = [0u8; 1024];
10511 rng.fill_bytes(&mut buf);
10512 let mut unstructured = Unstructured::new(&buf);
10513 Self::arbitrary(&mut unstructured).unwrap_or_default()
10514 }
10515}
10516impl Default for DATA_STREAM_DATA {
10517 fn default() -> Self {
10518 Self::DEFAULT.clone()
10519 }
10520}
10521impl MessageData for DATA_STREAM_DATA {
10522 type Message = MavMessage;
10523 const ID: u32 = 67u32;
10524 const NAME: &'static str = "DATA_STREAM";
10525 const EXTRA_CRC: u8 = 21u8;
10526 const ENCODED_LEN: usize = 4usize;
10527 fn deser(
10528 _version: MavlinkVersion,
10529 __input: &[u8],
10530 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10531 let avail_len = __input.len();
10532 let mut payload_buf = [0; Self::ENCODED_LEN];
10533 let mut buf = if avail_len < Self::ENCODED_LEN {
10534 payload_buf[0..avail_len].copy_from_slice(__input);
10535 Bytes::new(&payload_buf)
10536 } else {
10537 Bytes::new(__input)
10538 };
10539 let mut __struct = Self::default();
10540 __struct.message_rate = buf.get_u16_le();
10541 __struct.stream_id = buf.get_u8();
10542 __struct.on_off = buf.get_u8();
10543 Ok(__struct)
10544 }
10545 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10546 let mut __tmp = BytesMut::new(bytes);
10547 #[allow(clippy::absurd_extreme_comparisons)]
10548 #[allow(unused_comparisons)]
10549 if __tmp.remaining() < Self::ENCODED_LEN {
10550 panic!(
10551 "buffer is too small (need {} bytes, but got {})",
10552 Self::ENCODED_LEN,
10553 __tmp.remaining(),
10554 )
10555 }
10556 __tmp.put_u16_le(self.message_rate);
10557 __tmp.put_u8(self.stream_id);
10558 __tmp.put_u8(self.on_off);
10559 if matches!(version, MavlinkVersion::V2) {
10560 let len = __tmp.len();
10561 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10562 } else {
10563 __tmp.len()
10564 }
10565 }
10566}
10567#[doc = "id: 130"]
10568#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10569#[derive(Debug, Clone, PartialEq)]
10570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10572pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10573 #[doc = "total data size (set on ACK only)."]
10574 pub size: u32,
10575 #[doc = "Width of a matrix or image."]
10576 pub width: u16,
10577 #[doc = "Height of a matrix or image."]
10578 pub height: u16,
10579 #[doc = "Number of packets being sent (set on ACK only)."]
10580 pub packets: u16,
10581 #[doc = "Type of requested/acknowledged data."]
10582 pub mavtype: MavlinkDataStreamType,
10583 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10584 pub payload: u8,
10585 #[doc = "JPEG quality. Values: [1-100]."]
10586 pub jpg_quality: u8,
10587}
10588impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10589 pub const ENCODED_LEN: usize = 13usize;
10590 pub const DEFAULT: Self = Self {
10591 size: 0_u32,
10592 width: 0_u16,
10593 height: 0_u16,
10594 packets: 0_u16,
10595 mavtype: MavlinkDataStreamType::DEFAULT,
10596 payload: 0_u8,
10597 jpg_quality: 0_u8,
10598 };
10599 #[cfg(feature = "arbitrary")]
10600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10601 use arbitrary::{Arbitrary, Unstructured};
10602 let mut buf = [0u8; 1024];
10603 rng.fill_bytes(&mut buf);
10604 let mut unstructured = Unstructured::new(&buf);
10605 Self::arbitrary(&mut unstructured).unwrap_or_default()
10606 }
10607}
10608impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10609 fn default() -> Self {
10610 Self::DEFAULT.clone()
10611 }
10612}
10613impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10614 type Message = MavMessage;
10615 const ID: u32 = 130u32;
10616 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10617 const EXTRA_CRC: u8 = 29u8;
10618 const ENCODED_LEN: usize = 13usize;
10619 fn deser(
10620 _version: MavlinkVersion,
10621 __input: &[u8],
10622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10623 let avail_len = __input.len();
10624 let mut payload_buf = [0; Self::ENCODED_LEN];
10625 let mut buf = if avail_len < Self::ENCODED_LEN {
10626 payload_buf[0..avail_len].copy_from_slice(__input);
10627 Bytes::new(&payload_buf)
10628 } else {
10629 Bytes::new(__input)
10630 };
10631 let mut __struct = Self::default();
10632 __struct.size = buf.get_u32_le();
10633 __struct.width = buf.get_u16_le();
10634 __struct.height = buf.get_u16_le();
10635 __struct.packets = buf.get_u16_le();
10636 let tmp = buf.get_u8();
10637 __struct.mavtype =
10638 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10639 enum_type: "MavlinkDataStreamType",
10640 value: tmp as u32,
10641 })?;
10642 __struct.payload = buf.get_u8();
10643 __struct.jpg_quality = buf.get_u8();
10644 Ok(__struct)
10645 }
10646 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10647 let mut __tmp = BytesMut::new(bytes);
10648 #[allow(clippy::absurd_extreme_comparisons)]
10649 #[allow(unused_comparisons)]
10650 if __tmp.remaining() < Self::ENCODED_LEN {
10651 panic!(
10652 "buffer is too small (need {} bytes, but got {})",
10653 Self::ENCODED_LEN,
10654 __tmp.remaining(),
10655 )
10656 }
10657 __tmp.put_u32_le(self.size);
10658 __tmp.put_u16_le(self.width);
10659 __tmp.put_u16_le(self.height);
10660 __tmp.put_u16_le(self.packets);
10661 __tmp.put_u8(self.mavtype as u8);
10662 __tmp.put_u8(self.payload);
10663 __tmp.put_u8(self.jpg_quality);
10664 if matches!(version, MavlinkVersion::V2) {
10665 let len = __tmp.len();
10666 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10667 } else {
10668 __tmp.len()
10669 }
10670 }
10671}
10672#[doc = "id: 254"]
10673#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10674#[derive(Debug, Clone, PartialEq)]
10675#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10676#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10677pub struct DEBUG_DATA {
10678 #[doc = "Timestamp (time since system boot)."]
10679 pub time_boot_ms: u32,
10680 #[doc = "DEBUG value"]
10681 pub value: f32,
10682 #[doc = "index of debug variable"]
10683 pub ind: u8,
10684}
10685impl DEBUG_DATA {
10686 pub const ENCODED_LEN: usize = 9usize;
10687 pub const DEFAULT: Self = Self {
10688 time_boot_ms: 0_u32,
10689 value: 0.0_f32,
10690 ind: 0_u8,
10691 };
10692 #[cfg(feature = "arbitrary")]
10693 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10694 use arbitrary::{Arbitrary, Unstructured};
10695 let mut buf = [0u8; 1024];
10696 rng.fill_bytes(&mut buf);
10697 let mut unstructured = Unstructured::new(&buf);
10698 Self::arbitrary(&mut unstructured).unwrap_or_default()
10699 }
10700}
10701impl Default for DEBUG_DATA {
10702 fn default() -> Self {
10703 Self::DEFAULT.clone()
10704 }
10705}
10706impl MessageData for DEBUG_DATA {
10707 type Message = MavMessage;
10708 const ID: u32 = 254u32;
10709 const NAME: &'static str = "DEBUG";
10710 const EXTRA_CRC: u8 = 46u8;
10711 const ENCODED_LEN: usize = 9usize;
10712 fn deser(
10713 _version: MavlinkVersion,
10714 __input: &[u8],
10715 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10716 let avail_len = __input.len();
10717 let mut payload_buf = [0; Self::ENCODED_LEN];
10718 let mut buf = if avail_len < Self::ENCODED_LEN {
10719 payload_buf[0..avail_len].copy_from_slice(__input);
10720 Bytes::new(&payload_buf)
10721 } else {
10722 Bytes::new(__input)
10723 };
10724 let mut __struct = Self::default();
10725 __struct.time_boot_ms = buf.get_u32_le();
10726 __struct.value = buf.get_f32_le();
10727 __struct.ind = buf.get_u8();
10728 Ok(__struct)
10729 }
10730 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10731 let mut __tmp = BytesMut::new(bytes);
10732 #[allow(clippy::absurd_extreme_comparisons)]
10733 #[allow(unused_comparisons)]
10734 if __tmp.remaining() < Self::ENCODED_LEN {
10735 panic!(
10736 "buffer is too small (need {} bytes, but got {})",
10737 Self::ENCODED_LEN,
10738 __tmp.remaining(),
10739 )
10740 }
10741 __tmp.put_u32_le(self.time_boot_ms);
10742 __tmp.put_f32_le(self.value);
10743 __tmp.put_u8(self.ind);
10744 if matches!(version, MavlinkVersion::V2) {
10745 let len = __tmp.len();
10746 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10747 } else {
10748 __tmp.len()
10749 }
10750 }
10751}
10752#[doc = "id: 350"]
10753#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10754#[derive(Debug, Clone, PartialEq)]
10755#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10756#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10757pub struct DEBUG_FLOAT_ARRAY_DATA {
10758 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10759 pub time_usec: u64,
10760 #[doc = "Unique ID used to discriminate between arrays"]
10761 pub array_id: u16,
10762 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10763 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10764 pub name: [u8; 10],
10765 #[doc = "data"]
10766 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10767 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10768 pub data: [f32; 58],
10769}
10770impl DEBUG_FLOAT_ARRAY_DATA {
10771 pub const ENCODED_LEN: usize = 252usize;
10772 pub const DEFAULT: Self = Self {
10773 time_usec: 0_u64,
10774 array_id: 0_u16,
10775 name: [0_u8; 10usize],
10776 data: [0.0_f32; 58usize],
10777 };
10778 #[cfg(feature = "arbitrary")]
10779 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10780 use arbitrary::{Arbitrary, Unstructured};
10781 let mut buf = [0u8; 1024];
10782 rng.fill_bytes(&mut buf);
10783 let mut unstructured = Unstructured::new(&buf);
10784 Self::arbitrary(&mut unstructured).unwrap_or_default()
10785 }
10786}
10787impl Default for DEBUG_FLOAT_ARRAY_DATA {
10788 fn default() -> Self {
10789 Self::DEFAULT.clone()
10790 }
10791}
10792impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10793 type Message = MavMessage;
10794 const ID: u32 = 350u32;
10795 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10796 const EXTRA_CRC: u8 = 232u8;
10797 const ENCODED_LEN: usize = 252usize;
10798 fn deser(
10799 _version: MavlinkVersion,
10800 __input: &[u8],
10801 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10802 let avail_len = __input.len();
10803 let mut payload_buf = [0; Self::ENCODED_LEN];
10804 let mut buf = if avail_len < Self::ENCODED_LEN {
10805 payload_buf[0..avail_len].copy_from_slice(__input);
10806 Bytes::new(&payload_buf)
10807 } else {
10808 Bytes::new(__input)
10809 };
10810 let mut __struct = Self::default();
10811 __struct.time_usec = buf.get_u64_le();
10812 __struct.array_id = buf.get_u16_le();
10813 for v in &mut __struct.name {
10814 let val = buf.get_u8();
10815 *v = val;
10816 }
10817 for v in &mut __struct.data {
10818 let val = buf.get_f32_le();
10819 *v = val;
10820 }
10821 Ok(__struct)
10822 }
10823 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10824 let mut __tmp = BytesMut::new(bytes);
10825 #[allow(clippy::absurd_extreme_comparisons)]
10826 #[allow(unused_comparisons)]
10827 if __tmp.remaining() < Self::ENCODED_LEN {
10828 panic!(
10829 "buffer is too small (need {} bytes, but got {})",
10830 Self::ENCODED_LEN,
10831 __tmp.remaining(),
10832 )
10833 }
10834 __tmp.put_u64_le(self.time_usec);
10835 __tmp.put_u16_le(self.array_id);
10836 for val in &self.name {
10837 __tmp.put_u8(*val);
10838 }
10839 for val in &self.data {
10840 __tmp.put_f32_le(*val);
10841 }
10842 if matches!(version, MavlinkVersion::V2) {
10843 let len = __tmp.len();
10844 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10845 } else {
10846 __tmp.len()
10847 }
10848 }
10849}
10850#[doc = "id: 250"]
10851#[doc = "To debug something using a named 3D vector."]
10852#[derive(Debug, Clone, PartialEq)]
10853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10854#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10855pub struct DEBUG_VECT_DATA {
10856 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10857 pub time_usec: u64,
10858 #[doc = "x"]
10859 pub x: f32,
10860 #[doc = "y"]
10861 pub y: f32,
10862 #[doc = "z"]
10863 pub z: f32,
10864 #[doc = "Name"]
10865 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10866 pub name: [u8; 10],
10867}
10868impl DEBUG_VECT_DATA {
10869 pub const ENCODED_LEN: usize = 30usize;
10870 pub const DEFAULT: Self = Self {
10871 time_usec: 0_u64,
10872 x: 0.0_f32,
10873 y: 0.0_f32,
10874 z: 0.0_f32,
10875 name: [0_u8; 10usize],
10876 };
10877 #[cfg(feature = "arbitrary")]
10878 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10879 use arbitrary::{Arbitrary, Unstructured};
10880 let mut buf = [0u8; 1024];
10881 rng.fill_bytes(&mut buf);
10882 let mut unstructured = Unstructured::new(&buf);
10883 Self::arbitrary(&mut unstructured).unwrap_or_default()
10884 }
10885}
10886impl Default for DEBUG_VECT_DATA {
10887 fn default() -> Self {
10888 Self::DEFAULT.clone()
10889 }
10890}
10891impl MessageData for DEBUG_VECT_DATA {
10892 type Message = MavMessage;
10893 const ID: u32 = 250u32;
10894 const NAME: &'static str = "DEBUG_VECT";
10895 const EXTRA_CRC: u8 = 49u8;
10896 const ENCODED_LEN: usize = 30usize;
10897 fn deser(
10898 _version: MavlinkVersion,
10899 __input: &[u8],
10900 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10901 let avail_len = __input.len();
10902 let mut payload_buf = [0; Self::ENCODED_LEN];
10903 let mut buf = if avail_len < Self::ENCODED_LEN {
10904 payload_buf[0..avail_len].copy_from_slice(__input);
10905 Bytes::new(&payload_buf)
10906 } else {
10907 Bytes::new(__input)
10908 };
10909 let mut __struct = Self::default();
10910 __struct.time_usec = buf.get_u64_le();
10911 __struct.x = buf.get_f32_le();
10912 __struct.y = buf.get_f32_le();
10913 __struct.z = buf.get_f32_le();
10914 for v in &mut __struct.name {
10915 let val = buf.get_u8();
10916 *v = val;
10917 }
10918 Ok(__struct)
10919 }
10920 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10921 let mut __tmp = BytesMut::new(bytes);
10922 #[allow(clippy::absurd_extreme_comparisons)]
10923 #[allow(unused_comparisons)]
10924 if __tmp.remaining() < Self::ENCODED_LEN {
10925 panic!(
10926 "buffer is too small (need {} bytes, but got {})",
10927 Self::ENCODED_LEN,
10928 __tmp.remaining(),
10929 )
10930 }
10931 __tmp.put_u64_le(self.time_usec);
10932 __tmp.put_f32_le(self.x);
10933 __tmp.put_f32_le(self.y);
10934 __tmp.put_f32_le(self.z);
10935 for val in &self.name {
10936 __tmp.put_u8(*val);
10937 }
10938 if matches!(version, MavlinkVersion::V2) {
10939 let len = __tmp.len();
10940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10941 } else {
10942 __tmp.len()
10943 }
10944 }
10945}
10946#[doc = "id: 132"]
10947#[doc = "Distance sensor information for an onboard rangefinder."]
10948#[derive(Debug, Clone, PartialEq)]
10949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10951pub struct DISTANCE_SENSOR_DATA {
10952 #[doc = "Timestamp (time since system boot)."]
10953 pub time_boot_ms: u32,
10954 #[doc = "Minimum distance the sensor can measure"]
10955 pub min_distance: u16,
10956 #[doc = "Maximum distance the sensor can measure"]
10957 pub max_distance: u16,
10958 #[doc = "Current distance reading"]
10959 pub current_distance: u16,
10960 #[doc = "Type of distance sensor."]
10961 pub mavtype: MavDistanceSensor,
10962 #[doc = "Onboard ID of the sensor"]
10963 pub id: u8,
10964 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10965 pub orientation: MavSensorOrientation,
10966 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10967 pub covariance: u8,
10968 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10969 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10970 pub horizontal_fov: f32,
10971 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10972 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10973 pub vertical_fov: f32,
10974 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10975 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10976 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10977 pub quaternion: [f32; 4],
10978 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10979 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10980 pub signal_quality: u8,
10981}
10982impl DISTANCE_SENSOR_DATA {
10983 pub const ENCODED_LEN: usize = 39usize;
10984 pub const DEFAULT: Self = Self {
10985 time_boot_ms: 0_u32,
10986 min_distance: 0_u16,
10987 max_distance: 0_u16,
10988 current_distance: 0_u16,
10989 mavtype: MavDistanceSensor::DEFAULT,
10990 id: 0_u8,
10991 orientation: MavSensorOrientation::DEFAULT,
10992 covariance: 0_u8,
10993 horizontal_fov: 0.0_f32,
10994 vertical_fov: 0.0_f32,
10995 quaternion: [0.0_f32; 4usize],
10996 signal_quality: 0_u8,
10997 };
10998 #[cfg(feature = "arbitrary")]
10999 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11000 use arbitrary::{Arbitrary, Unstructured};
11001 let mut buf = [0u8; 1024];
11002 rng.fill_bytes(&mut buf);
11003 let mut unstructured = Unstructured::new(&buf);
11004 Self::arbitrary(&mut unstructured).unwrap_or_default()
11005 }
11006}
11007impl Default for DISTANCE_SENSOR_DATA {
11008 fn default() -> Self {
11009 Self::DEFAULT.clone()
11010 }
11011}
11012impl MessageData for DISTANCE_SENSOR_DATA {
11013 type Message = MavMessage;
11014 const ID: u32 = 132u32;
11015 const NAME: &'static str = "DISTANCE_SENSOR";
11016 const EXTRA_CRC: u8 = 85u8;
11017 const ENCODED_LEN: usize = 39usize;
11018 fn deser(
11019 _version: MavlinkVersion,
11020 __input: &[u8],
11021 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11022 let avail_len = __input.len();
11023 let mut payload_buf = [0; Self::ENCODED_LEN];
11024 let mut buf = if avail_len < Self::ENCODED_LEN {
11025 payload_buf[0..avail_len].copy_from_slice(__input);
11026 Bytes::new(&payload_buf)
11027 } else {
11028 Bytes::new(__input)
11029 };
11030 let mut __struct = Self::default();
11031 __struct.time_boot_ms = buf.get_u32_le();
11032 __struct.min_distance = buf.get_u16_le();
11033 __struct.max_distance = buf.get_u16_le();
11034 __struct.current_distance = buf.get_u16_le();
11035 let tmp = buf.get_u8();
11036 __struct.mavtype =
11037 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11038 enum_type: "MavDistanceSensor",
11039 value: tmp as u32,
11040 })?;
11041 __struct.id = buf.get_u8();
11042 let tmp = buf.get_u8();
11043 __struct.orientation =
11044 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11045 enum_type: "MavSensorOrientation",
11046 value: tmp as u32,
11047 })?;
11048 __struct.covariance = buf.get_u8();
11049 __struct.horizontal_fov = buf.get_f32_le();
11050 __struct.vertical_fov = buf.get_f32_le();
11051 for v in &mut __struct.quaternion {
11052 let val = buf.get_f32_le();
11053 *v = val;
11054 }
11055 __struct.signal_quality = buf.get_u8();
11056 Ok(__struct)
11057 }
11058 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11059 let mut __tmp = BytesMut::new(bytes);
11060 #[allow(clippy::absurd_extreme_comparisons)]
11061 #[allow(unused_comparisons)]
11062 if __tmp.remaining() < Self::ENCODED_LEN {
11063 panic!(
11064 "buffer is too small (need {} bytes, but got {})",
11065 Self::ENCODED_LEN,
11066 __tmp.remaining(),
11067 )
11068 }
11069 __tmp.put_u32_le(self.time_boot_ms);
11070 __tmp.put_u16_le(self.min_distance);
11071 __tmp.put_u16_le(self.max_distance);
11072 __tmp.put_u16_le(self.current_distance);
11073 __tmp.put_u8(self.mavtype as u8);
11074 __tmp.put_u8(self.id);
11075 __tmp.put_u8(self.orientation as u8);
11076 __tmp.put_u8(self.covariance);
11077 __tmp.put_f32_le(self.horizontal_fov);
11078 __tmp.put_f32_le(self.vertical_fov);
11079 for val in &self.quaternion {
11080 __tmp.put_f32_le(*val);
11081 }
11082 __tmp.put_u8(self.signal_quality);
11083 if matches!(version, MavlinkVersion::V2) {
11084 let len = __tmp.len();
11085 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11086 } else {
11087 __tmp.len()
11088 }
11089 }
11090}
11091#[doc = "id: 225"]
11092#[doc = "EFI status output."]
11093#[derive(Debug, Clone, PartialEq)]
11094#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11095#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11096pub struct EFI_STATUS_DATA {
11097 #[doc = "ECU index"]
11098 pub ecu_index: f32,
11099 #[doc = "RPM"]
11100 pub rpm: f32,
11101 #[doc = "Fuel consumed"]
11102 pub fuel_consumed: f32,
11103 #[doc = "Fuel flow rate"]
11104 pub fuel_flow: f32,
11105 #[doc = "Engine load"]
11106 pub engine_load: f32,
11107 #[doc = "Throttle position"]
11108 pub throttle_position: f32,
11109 #[doc = "Spark dwell time"]
11110 pub spark_dwell_time: f32,
11111 #[doc = "Barometric pressure"]
11112 pub barometric_pressure: f32,
11113 #[doc = "Intake manifold pressure("]
11114 pub intake_manifold_pressure: f32,
11115 #[doc = "Intake manifold temperature"]
11116 pub intake_manifold_temperature: f32,
11117 #[doc = "Cylinder head temperature"]
11118 pub cylinder_head_temperature: f32,
11119 #[doc = "Ignition timing (Crank angle degrees)"]
11120 pub ignition_timing: f32,
11121 #[doc = "Injection time"]
11122 pub injection_time: f32,
11123 #[doc = "Exhaust gas temperature"]
11124 pub exhaust_gas_temperature: f32,
11125 #[doc = "Output throttle"]
11126 pub throttle_out: f32,
11127 #[doc = "Pressure/temperature compensation"]
11128 pub pt_compensation: f32,
11129 #[doc = "EFI health status"]
11130 pub health: u8,
11131 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
11132 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11133 pub ignition_voltage: f32,
11134 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
11135 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11136 pub fuel_pressure: f32,
11137}
11138impl EFI_STATUS_DATA {
11139 pub const ENCODED_LEN: usize = 73usize;
11140 pub const DEFAULT: Self = Self {
11141 ecu_index: 0.0_f32,
11142 rpm: 0.0_f32,
11143 fuel_consumed: 0.0_f32,
11144 fuel_flow: 0.0_f32,
11145 engine_load: 0.0_f32,
11146 throttle_position: 0.0_f32,
11147 spark_dwell_time: 0.0_f32,
11148 barometric_pressure: 0.0_f32,
11149 intake_manifold_pressure: 0.0_f32,
11150 intake_manifold_temperature: 0.0_f32,
11151 cylinder_head_temperature: 0.0_f32,
11152 ignition_timing: 0.0_f32,
11153 injection_time: 0.0_f32,
11154 exhaust_gas_temperature: 0.0_f32,
11155 throttle_out: 0.0_f32,
11156 pt_compensation: 0.0_f32,
11157 health: 0_u8,
11158 ignition_voltage: 0.0_f32,
11159 fuel_pressure: 0.0_f32,
11160 };
11161 #[cfg(feature = "arbitrary")]
11162 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11163 use arbitrary::{Arbitrary, Unstructured};
11164 let mut buf = [0u8; 1024];
11165 rng.fill_bytes(&mut buf);
11166 let mut unstructured = Unstructured::new(&buf);
11167 Self::arbitrary(&mut unstructured).unwrap_or_default()
11168 }
11169}
11170impl Default for EFI_STATUS_DATA {
11171 fn default() -> Self {
11172 Self::DEFAULT.clone()
11173 }
11174}
11175impl MessageData for EFI_STATUS_DATA {
11176 type Message = MavMessage;
11177 const ID: u32 = 225u32;
11178 const NAME: &'static str = "EFI_STATUS";
11179 const EXTRA_CRC: u8 = 208u8;
11180 const ENCODED_LEN: usize = 73usize;
11181 fn deser(
11182 _version: MavlinkVersion,
11183 __input: &[u8],
11184 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11185 let avail_len = __input.len();
11186 let mut payload_buf = [0; Self::ENCODED_LEN];
11187 let mut buf = if avail_len < Self::ENCODED_LEN {
11188 payload_buf[0..avail_len].copy_from_slice(__input);
11189 Bytes::new(&payload_buf)
11190 } else {
11191 Bytes::new(__input)
11192 };
11193 let mut __struct = Self::default();
11194 __struct.ecu_index = buf.get_f32_le();
11195 __struct.rpm = buf.get_f32_le();
11196 __struct.fuel_consumed = buf.get_f32_le();
11197 __struct.fuel_flow = buf.get_f32_le();
11198 __struct.engine_load = buf.get_f32_le();
11199 __struct.throttle_position = buf.get_f32_le();
11200 __struct.spark_dwell_time = buf.get_f32_le();
11201 __struct.barometric_pressure = buf.get_f32_le();
11202 __struct.intake_manifold_pressure = buf.get_f32_le();
11203 __struct.intake_manifold_temperature = buf.get_f32_le();
11204 __struct.cylinder_head_temperature = buf.get_f32_le();
11205 __struct.ignition_timing = buf.get_f32_le();
11206 __struct.injection_time = buf.get_f32_le();
11207 __struct.exhaust_gas_temperature = buf.get_f32_le();
11208 __struct.throttle_out = buf.get_f32_le();
11209 __struct.pt_compensation = buf.get_f32_le();
11210 __struct.health = buf.get_u8();
11211 __struct.ignition_voltage = buf.get_f32_le();
11212 __struct.fuel_pressure = buf.get_f32_le();
11213 Ok(__struct)
11214 }
11215 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11216 let mut __tmp = BytesMut::new(bytes);
11217 #[allow(clippy::absurd_extreme_comparisons)]
11218 #[allow(unused_comparisons)]
11219 if __tmp.remaining() < Self::ENCODED_LEN {
11220 panic!(
11221 "buffer is too small (need {} bytes, but got {})",
11222 Self::ENCODED_LEN,
11223 __tmp.remaining(),
11224 )
11225 }
11226 __tmp.put_f32_le(self.ecu_index);
11227 __tmp.put_f32_le(self.rpm);
11228 __tmp.put_f32_le(self.fuel_consumed);
11229 __tmp.put_f32_le(self.fuel_flow);
11230 __tmp.put_f32_le(self.engine_load);
11231 __tmp.put_f32_le(self.throttle_position);
11232 __tmp.put_f32_le(self.spark_dwell_time);
11233 __tmp.put_f32_le(self.barometric_pressure);
11234 __tmp.put_f32_le(self.intake_manifold_pressure);
11235 __tmp.put_f32_le(self.intake_manifold_temperature);
11236 __tmp.put_f32_le(self.cylinder_head_temperature);
11237 __tmp.put_f32_le(self.ignition_timing);
11238 __tmp.put_f32_le(self.injection_time);
11239 __tmp.put_f32_le(self.exhaust_gas_temperature);
11240 __tmp.put_f32_le(self.throttle_out);
11241 __tmp.put_f32_le(self.pt_compensation);
11242 __tmp.put_u8(self.health);
11243 __tmp.put_f32_le(self.ignition_voltage);
11244 __tmp.put_f32_le(self.fuel_pressure);
11245 if matches!(version, MavlinkVersion::V2) {
11246 let len = __tmp.len();
11247 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11248 } else {
11249 __tmp.len()
11250 }
11251 }
11252}
11253#[doc = "id: 8007"]
11254#[doc = "Extended EKF state estimates for ASLUAVs."]
11255#[derive(Debug, Clone, PartialEq)]
11256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11258pub struct EKF_EXT_DATA {
11259 #[doc = "Time since system start"]
11260 pub timestamp: u64,
11261 #[doc = "Magnitude of wind velocity (in lateral inertial plane)"]
11262 pub Windspeed: f32,
11263 #[doc = "Wind heading angle from North"]
11264 pub WindDir: f32,
11265 #[doc = "Z (Down) component of inertial wind velocity"]
11266 pub WindZ: f32,
11267 #[doc = "Magnitude of air velocity"]
11268 pub Airspeed: f32,
11269 #[doc = "Sideslip angle"]
11270 pub beta: f32,
11271 #[doc = "Angle of attack"]
11272 pub alpha: f32,
11273}
11274impl EKF_EXT_DATA {
11275 pub const ENCODED_LEN: usize = 32usize;
11276 pub const DEFAULT: Self = Self {
11277 timestamp: 0_u64,
11278 Windspeed: 0.0_f32,
11279 WindDir: 0.0_f32,
11280 WindZ: 0.0_f32,
11281 Airspeed: 0.0_f32,
11282 beta: 0.0_f32,
11283 alpha: 0.0_f32,
11284 };
11285 #[cfg(feature = "arbitrary")]
11286 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11287 use arbitrary::{Arbitrary, Unstructured};
11288 let mut buf = [0u8; 1024];
11289 rng.fill_bytes(&mut buf);
11290 let mut unstructured = Unstructured::new(&buf);
11291 Self::arbitrary(&mut unstructured).unwrap_or_default()
11292 }
11293}
11294impl Default for EKF_EXT_DATA {
11295 fn default() -> Self {
11296 Self::DEFAULT.clone()
11297 }
11298}
11299impl MessageData for EKF_EXT_DATA {
11300 type Message = MavMessage;
11301 const ID: u32 = 8007u32;
11302 const NAME: &'static str = "EKF_EXT";
11303 const EXTRA_CRC: u8 = 64u8;
11304 const ENCODED_LEN: usize = 32usize;
11305 fn deser(
11306 _version: MavlinkVersion,
11307 __input: &[u8],
11308 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11309 let avail_len = __input.len();
11310 let mut payload_buf = [0; Self::ENCODED_LEN];
11311 let mut buf = if avail_len < Self::ENCODED_LEN {
11312 payload_buf[0..avail_len].copy_from_slice(__input);
11313 Bytes::new(&payload_buf)
11314 } else {
11315 Bytes::new(__input)
11316 };
11317 let mut __struct = Self::default();
11318 __struct.timestamp = buf.get_u64_le();
11319 __struct.Windspeed = buf.get_f32_le();
11320 __struct.WindDir = buf.get_f32_le();
11321 __struct.WindZ = buf.get_f32_le();
11322 __struct.Airspeed = buf.get_f32_le();
11323 __struct.beta = buf.get_f32_le();
11324 __struct.alpha = buf.get_f32_le();
11325 Ok(__struct)
11326 }
11327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11328 let mut __tmp = BytesMut::new(bytes);
11329 #[allow(clippy::absurd_extreme_comparisons)]
11330 #[allow(unused_comparisons)]
11331 if __tmp.remaining() < Self::ENCODED_LEN {
11332 panic!(
11333 "buffer is too small (need {} bytes, but got {})",
11334 Self::ENCODED_LEN,
11335 __tmp.remaining(),
11336 )
11337 }
11338 __tmp.put_u64_le(self.timestamp);
11339 __tmp.put_f32_le(self.Windspeed);
11340 __tmp.put_f32_le(self.WindDir);
11341 __tmp.put_f32_le(self.WindZ);
11342 __tmp.put_f32_le(self.Airspeed);
11343 __tmp.put_f32_le(self.beta);
11344 __tmp.put_f32_le(self.alpha);
11345 if matches!(version, MavlinkVersion::V2) {
11346 let len = __tmp.len();
11347 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11348 } else {
11349 __tmp.len()
11350 }
11351 }
11352}
11353#[doc = "id: 131"]
11354#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11355#[derive(Debug, Clone, PartialEq)]
11356#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11357#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11358pub struct ENCAPSULATED_DATA_DATA {
11359 #[doc = "sequence number (starting with 0 on every transmission)"]
11360 pub seqnr: u16,
11361 #[doc = "image data bytes"]
11362 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11363 pub data: [u8; 253],
11364}
11365impl ENCAPSULATED_DATA_DATA {
11366 pub const ENCODED_LEN: usize = 255usize;
11367 pub const DEFAULT: Self = Self {
11368 seqnr: 0_u16,
11369 data: [0_u8; 253usize],
11370 };
11371 #[cfg(feature = "arbitrary")]
11372 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11373 use arbitrary::{Arbitrary, Unstructured};
11374 let mut buf = [0u8; 1024];
11375 rng.fill_bytes(&mut buf);
11376 let mut unstructured = Unstructured::new(&buf);
11377 Self::arbitrary(&mut unstructured).unwrap_or_default()
11378 }
11379}
11380impl Default for ENCAPSULATED_DATA_DATA {
11381 fn default() -> Self {
11382 Self::DEFAULT.clone()
11383 }
11384}
11385impl MessageData for ENCAPSULATED_DATA_DATA {
11386 type Message = MavMessage;
11387 const ID: u32 = 131u32;
11388 const NAME: &'static str = "ENCAPSULATED_DATA";
11389 const EXTRA_CRC: u8 = 223u8;
11390 const ENCODED_LEN: usize = 255usize;
11391 fn deser(
11392 _version: MavlinkVersion,
11393 __input: &[u8],
11394 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11395 let avail_len = __input.len();
11396 let mut payload_buf = [0; Self::ENCODED_LEN];
11397 let mut buf = if avail_len < Self::ENCODED_LEN {
11398 payload_buf[0..avail_len].copy_from_slice(__input);
11399 Bytes::new(&payload_buf)
11400 } else {
11401 Bytes::new(__input)
11402 };
11403 let mut __struct = Self::default();
11404 __struct.seqnr = buf.get_u16_le();
11405 for v in &mut __struct.data {
11406 let val = buf.get_u8();
11407 *v = val;
11408 }
11409 Ok(__struct)
11410 }
11411 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11412 let mut __tmp = BytesMut::new(bytes);
11413 #[allow(clippy::absurd_extreme_comparisons)]
11414 #[allow(unused_comparisons)]
11415 if __tmp.remaining() < Self::ENCODED_LEN {
11416 panic!(
11417 "buffer is too small (need {} bytes, but got {})",
11418 Self::ENCODED_LEN,
11419 __tmp.remaining(),
11420 )
11421 }
11422 __tmp.put_u16_le(self.seqnr);
11423 for val in &self.data {
11424 __tmp.put_u8(*val);
11425 }
11426 if matches!(version, MavlinkVersion::V2) {
11427 let len = __tmp.len();
11428 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11429 } else {
11430 __tmp.len()
11431 }
11432 }
11433}
11434#[doc = "id: 290"]
11435#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11436#[derive(Debug, Clone, PartialEq)]
11437#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11438#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11439pub struct ESC_INFO_DATA {
11440 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11441 pub time_usec: u64,
11442 #[doc = "Number of reported errors by each ESC since boot."]
11443 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11444 pub error_count: [u32; 4],
11445 #[doc = "Counter of data packets received."]
11446 pub counter: u16,
11447 #[doc = "Bitmap of ESC failure flags."]
11448 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11449 pub failure_flags: [u16; 4],
11450 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11451 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11452 pub temperature: [i16; 4],
11453 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11454 pub index: u8,
11455 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11456 pub count: u8,
11457 #[doc = "Connection type protocol for all ESC."]
11458 pub connection_type: EscConnectionType,
11459 #[doc = "Information regarding online/offline status of each ESC."]
11460 pub info: u8,
11461}
11462impl ESC_INFO_DATA {
11463 pub const ENCODED_LEN: usize = 46usize;
11464 pub const DEFAULT: Self = Self {
11465 time_usec: 0_u64,
11466 error_count: [0_u32; 4usize],
11467 counter: 0_u16,
11468 failure_flags: [0_u16; 4usize],
11469 temperature: [0_i16; 4usize],
11470 index: 0_u8,
11471 count: 0_u8,
11472 connection_type: EscConnectionType::DEFAULT,
11473 info: 0_u8,
11474 };
11475 #[cfg(feature = "arbitrary")]
11476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11477 use arbitrary::{Arbitrary, Unstructured};
11478 let mut buf = [0u8; 1024];
11479 rng.fill_bytes(&mut buf);
11480 let mut unstructured = Unstructured::new(&buf);
11481 Self::arbitrary(&mut unstructured).unwrap_or_default()
11482 }
11483}
11484impl Default for ESC_INFO_DATA {
11485 fn default() -> Self {
11486 Self::DEFAULT.clone()
11487 }
11488}
11489impl MessageData for ESC_INFO_DATA {
11490 type Message = MavMessage;
11491 const ID: u32 = 290u32;
11492 const NAME: &'static str = "ESC_INFO";
11493 const EXTRA_CRC: u8 = 251u8;
11494 const ENCODED_LEN: usize = 46usize;
11495 fn deser(
11496 _version: MavlinkVersion,
11497 __input: &[u8],
11498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11499 let avail_len = __input.len();
11500 let mut payload_buf = [0; Self::ENCODED_LEN];
11501 let mut buf = if avail_len < Self::ENCODED_LEN {
11502 payload_buf[0..avail_len].copy_from_slice(__input);
11503 Bytes::new(&payload_buf)
11504 } else {
11505 Bytes::new(__input)
11506 };
11507 let mut __struct = Self::default();
11508 __struct.time_usec = buf.get_u64_le();
11509 for v in &mut __struct.error_count {
11510 let val = buf.get_u32_le();
11511 *v = val;
11512 }
11513 __struct.counter = buf.get_u16_le();
11514 for v in &mut __struct.failure_flags {
11515 let val = buf.get_u16_le();
11516 *v = val;
11517 }
11518 for v in &mut __struct.temperature {
11519 let val = buf.get_i16_le();
11520 *v = val;
11521 }
11522 __struct.index = buf.get_u8();
11523 __struct.count = buf.get_u8();
11524 let tmp = buf.get_u8();
11525 __struct.connection_type =
11526 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11527 enum_type: "EscConnectionType",
11528 value: tmp as u32,
11529 })?;
11530 __struct.info = buf.get_u8();
11531 Ok(__struct)
11532 }
11533 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11534 let mut __tmp = BytesMut::new(bytes);
11535 #[allow(clippy::absurd_extreme_comparisons)]
11536 #[allow(unused_comparisons)]
11537 if __tmp.remaining() < Self::ENCODED_LEN {
11538 panic!(
11539 "buffer is too small (need {} bytes, but got {})",
11540 Self::ENCODED_LEN,
11541 __tmp.remaining(),
11542 )
11543 }
11544 __tmp.put_u64_le(self.time_usec);
11545 for val in &self.error_count {
11546 __tmp.put_u32_le(*val);
11547 }
11548 __tmp.put_u16_le(self.counter);
11549 for val in &self.failure_flags {
11550 __tmp.put_u16_le(*val);
11551 }
11552 for val in &self.temperature {
11553 __tmp.put_i16_le(*val);
11554 }
11555 __tmp.put_u8(self.index);
11556 __tmp.put_u8(self.count);
11557 __tmp.put_u8(self.connection_type as u8);
11558 __tmp.put_u8(self.info);
11559 if matches!(version, MavlinkVersion::V2) {
11560 let len = __tmp.len();
11561 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11562 } else {
11563 __tmp.len()
11564 }
11565 }
11566}
11567#[doc = "id: 291"]
11568#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11569#[derive(Debug, Clone, PartialEq)]
11570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11572pub struct ESC_STATUS_DATA {
11573 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11574 pub time_usec: u64,
11575 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11576 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11577 pub rpm: [i32; 4],
11578 #[doc = "Voltage measured from each ESC."]
11579 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11580 pub voltage: [f32; 4],
11581 #[doc = "Current measured from each ESC."]
11582 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11583 pub current: [f32; 4],
11584 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11585 pub index: u8,
11586}
11587impl ESC_STATUS_DATA {
11588 pub const ENCODED_LEN: usize = 57usize;
11589 pub const DEFAULT: Self = Self {
11590 time_usec: 0_u64,
11591 rpm: [0_i32; 4usize],
11592 voltage: [0.0_f32; 4usize],
11593 current: [0.0_f32; 4usize],
11594 index: 0_u8,
11595 };
11596 #[cfg(feature = "arbitrary")]
11597 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11598 use arbitrary::{Arbitrary, Unstructured};
11599 let mut buf = [0u8; 1024];
11600 rng.fill_bytes(&mut buf);
11601 let mut unstructured = Unstructured::new(&buf);
11602 Self::arbitrary(&mut unstructured).unwrap_or_default()
11603 }
11604}
11605impl Default for ESC_STATUS_DATA {
11606 fn default() -> Self {
11607 Self::DEFAULT.clone()
11608 }
11609}
11610impl MessageData for ESC_STATUS_DATA {
11611 type Message = MavMessage;
11612 const ID: u32 = 291u32;
11613 const NAME: &'static str = "ESC_STATUS";
11614 const EXTRA_CRC: u8 = 10u8;
11615 const ENCODED_LEN: usize = 57usize;
11616 fn deser(
11617 _version: MavlinkVersion,
11618 __input: &[u8],
11619 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11620 let avail_len = __input.len();
11621 let mut payload_buf = [0; Self::ENCODED_LEN];
11622 let mut buf = if avail_len < Self::ENCODED_LEN {
11623 payload_buf[0..avail_len].copy_from_slice(__input);
11624 Bytes::new(&payload_buf)
11625 } else {
11626 Bytes::new(__input)
11627 };
11628 let mut __struct = Self::default();
11629 __struct.time_usec = buf.get_u64_le();
11630 for v in &mut __struct.rpm {
11631 let val = buf.get_i32_le();
11632 *v = val;
11633 }
11634 for v in &mut __struct.voltage {
11635 let val = buf.get_f32_le();
11636 *v = val;
11637 }
11638 for v in &mut __struct.current {
11639 let val = buf.get_f32_le();
11640 *v = val;
11641 }
11642 __struct.index = buf.get_u8();
11643 Ok(__struct)
11644 }
11645 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11646 let mut __tmp = BytesMut::new(bytes);
11647 #[allow(clippy::absurd_extreme_comparisons)]
11648 #[allow(unused_comparisons)]
11649 if __tmp.remaining() < Self::ENCODED_LEN {
11650 panic!(
11651 "buffer is too small (need {} bytes, but got {})",
11652 Self::ENCODED_LEN,
11653 __tmp.remaining(),
11654 )
11655 }
11656 __tmp.put_u64_le(self.time_usec);
11657 for val in &self.rpm {
11658 __tmp.put_i32_le(*val);
11659 }
11660 for val in &self.voltage {
11661 __tmp.put_f32_le(*val);
11662 }
11663 for val in &self.current {
11664 __tmp.put_f32_le(*val);
11665 }
11666 __tmp.put_u8(self.index);
11667 if matches!(version, MavlinkVersion::V2) {
11668 let len = __tmp.len();
11669 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11670 } else {
11671 __tmp.len()
11672 }
11673 }
11674}
11675#[doc = "id: 230"]
11676#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11677#[derive(Debug, Clone, PartialEq)]
11678#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11679#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11680pub struct ESTIMATOR_STATUS_DATA {
11681 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11682 pub time_usec: u64,
11683 #[doc = "Velocity innovation test ratio"]
11684 pub vel_ratio: f32,
11685 #[doc = "Horizontal position innovation test ratio"]
11686 pub pos_horiz_ratio: f32,
11687 #[doc = "Vertical position innovation test ratio"]
11688 pub pos_vert_ratio: f32,
11689 #[doc = "Magnetometer innovation test ratio"]
11690 pub mag_ratio: f32,
11691 #[doc = "Height above terrain innovation test ratio"]
11692 pub hagl_ratio: f32,
11693 #[doc = "True airspeed innovation test ratio"]
11694 pub tas_ratio: f32,
11695 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11696 pub pos_horiz_accuracy: f32,
11697 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11698 pub pos_vert_accuracy: f32,
11699 #[doc = "Bitmap indicating which EKF outputs are valid."]
11700 pub flags: EstimatorStatusFlags,
11701}
11702impl ESTIMATOR_STATUS_DATA {
11703 pub const ENCODED_LEN: usize = 42usize;
11704 pub const DEFAULT: Self = Self {
11705 time_usec: 0_u64,
11706 vel_ratio: 0.0_f32,
11707 pos_horiz_ratio: 0.0_f32,
11708 pos_vert_ratio: 0.0_f32,
11709 mag_ratio: 0.0_f32,
11710 hagl_ratio: 0.0_f32,
11711 tas_ratio: 0.0_f32,
11712 pos_horiz_accuracy: 0.0_f32,
11713 pos_vert_accuracy: 0.0_f32,
11714 flags: EstimatorStatusFlags::DEFAULT,
11715 };
11716 #[cfg(feature = "arbitrary")]
11717 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11718 use arbitrary::{Arbitrary, Unstructured};
11719 let mut buf = [0u8; 1024];
11720 rng.fill_bytes(&mut buf);
11721 let mut unstructured = Unstructured::new(&buf);
11722 Self::arbitrary(&mut unstructured).unwrap_or_default()
11723 }
11724}
11725impl Default for ESTIMATOR_STATUS_DATA {
11726 fn default() -> Self {
11727 Self::DEFAULT.clone()
11728 }
11729}
11730impl MessageData for ESTIMATOR_STATUS_DATA {
11731 type Message = MavMessage;
11732 const ID: u32 = 230u32;
11733 const NAME: &'static str = "ESTIMATOR_STATUS";
11734 const EXTRA_CRC: u8 = 163u8;
11735 const ENCODED_LEN: usize = 42usize;
11736 fn deser(
11737 _version: MavlinkVersion,
11738 __input: &[u8],
11739 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11740 let avail_len = __input.len();
11741 let mut payload_buf = [0; Self::ENCODED_LEN];
11742 let mut buf = if avail_len < Self::ENCODED_LEN {
11743 payload_buf[0..avail_len].copy_from_slice(__input);
11744 Bytes::new(&payload_buf)
11745 } else {
11746 Bytes::new(__input)
11747 };
11748 let mut __struct = Self::default();
11749 __struct.time_usec = buf.get_u64_le();
11750 __struct.vel_ratio = buf.get_f32_le();
11751 __struct.pos_horiz_ratio = buf.get_f32_le();
11752 __struct.pos_vert_ratio = buf.get_f32_le();
11753 __struct.mag_ratio = buf.get_f32_le();
11754 __struct.hagl_ratio = buf.get_f32_le();
11755 __struct.tas_ratio = buf.get_f32_le();
11756 __struct.pos_horiz_accuracy = buf.get_f32_le();
11757 __struct.pos_vert_accuracy = buf.get_f32_le();
11758 let tmp = buf.get_u16_le();
11759 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11760 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11761 flag_type: "EstimatorStatusFlags",
11762 value: tmp as u32,
11763 })?;
11764 Ok(__struct)
11765 }
11766 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11767 let mut __tmp = BytesMut::new(bytes);
11768 #[allow(clippy::absurd_extreme_comparisons)]
11769 #[allow(unused_comparisons)]
11770 if __tmp.remaining() < Self::ENCODED_LEN {
11771 panic!(
11772 "buffer is too small (need {} bytes, but got {})",
11773 Self::ENCODED_LEN,
11774 __tmp.remaining(),
11775 )
11776 }
11777 __tmp.put_u64_le(self.time_usec);
11778 __tmp.put_f32_le(self.vel_ratio);
11779 __tmp.put_f32_le(self.pos_horiz_ratio);
11780 __tmp.put_f32_le(self.pos_vert_ratio);
11781 __tmp.put_f32_le(self.mag_ratio);
11782 __tmp.put_f32_le(self.hagl_ratio);
11783 __tmp.put_f32_le(self.tas_ratio);
11784 __tmp.put_f32_le(self.pos_horiz_accuracy);
11785 __tmp.put_f32_le(self.pos_vert_accuracy);
11786 __tmp.put_u16_le(self.flags.bits());
11787 if matches!(version, MavlinkVersion::V2) {
11788 let len = __tmp.len();
11789 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11790 } else {
11791 __tmp.len()
11792 }
11793 }
11794}
11795#[doc = "id: 410"]
11796#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11797#[derive(Debug, Clone, PartialEq)]
11798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11800pub struct EVENT_DATA {
11801 #[doc = "Event ID (as defined in the component metadata)"]
11802 pub id: u32,
11803 #[doc = "Timestamp (time since system boot when the event happened)."]
11804 pub event_time_boot_ms: u32,
11805 #[doc = "Sequence number."]
11806 pub sequence: u16,
11807 #[doc = "Component ID"]
11808 pub destination_component: u8,
11809 #[doc = "System ID"]
11810 pub destination_system: u8,
11811 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11812 pub log_levels: u8,
11813 #[doc = "Arguments (depend on event ID)."]
11814 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11815 pub arguments: [u8; 40],
11816}
11817impl EVENT_DATA {
11818 pub const ENCODED_LEN: usize = 53usize;
11819 pub const DEFAULT: Self = Self {
11820 id: 0_u32,
11821 event_time_boot_ms: 0_u32,
11822 sequence: 0_u16,
11823 destination_component: 0_u8,
11824 destination_system: 0_u8,
11825 log_levels: 0_u8,
11826 arguments: [0_u8; 40usize],
11827 };
11828 #[cfg(feature = "arbitrary")]
11829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11830 use arbitrary::{Arbitrary, Unstructured};
11831 let mut buf = [0u8; 1024];
11832 rng.fill_bytes(&mut buf);
11833 let mut unstructured = Unstructured::new(&buf);
11834 Self::arbitrary(&mut unstructured).unwrap_or_default()
11835 }
11836}
11837impl Default for EVENT_DATA {
11838 fn default() -> Self {
11839 Self::DEFAULT.clone()
11840 }
11841}
11842impl MessageData for EVENT_DATA {
11843 type Message = MavMessage;
11844 const ID: u32 = 410u32;
11845 const NAME: &'static str = "EVENT";
11846 const EXTRA_CRC: u8 = 160u8;
11847 const ENCODED_LEN: usize = 53usize;
11848 fn deser(
11849 _version: MavlinkVersion,
11850 __input: &[u8],
11851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11852 let avail_len = __input.len();
11853 let mut payload_buf = [0; Self::ENCODED_LEN];
11854 let mut buf = if avail_len < Self::ENCODED_LEN {
11855 payload_buf[0..avail_len].copy_from_slice(__input);
11856 Bytes::new(&payload_buf)
11857 } else {
11858 Bytes::new(__input)
11859 };
11860 let mut __struct = Self::default();
11861 __struct.id = buf.get_u32_le();
11862 __struct.event_time_boot_ms = buf.get_u32_le();
11863 __struct.sequence = buf.get_u16_le();
11864 __struct.destination_component = buf.get_u8();
11865 __struct.destination_system = buf.get_u8();
11866 __struct.log_levels = buf.get_u8();
11867 for v in &mut __struct.arguments {
11868 let val = buf.get_u8();
11869 *v = val;
11870 }
11871 Ok(__struct)
11872 }
11873 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11874 let mut __tmp = BytesMut::new(bytes);
11875 #[allow(clippy::absurd_extreme_comparisons)]
11876 #[allow(unused_comparisons)]
11877 if __tmp.remaining() < Self::ENCODED_LEN {
11878 panic!(
11879 "buffer is too small (need {} bytes, but got {})",
11880 Self::ENCODED_LEN,
11881 __tmp.remaining(),
11882 )
11883 }
11884 __tmp.put_u32_le(self.id);
11885 __tmp.put_u32_le(self.event_time_boot_ms);
11886 __tmp.put_u16_le(self.sequence);
11887 __tmp.put_u8(self.destination_component);
11888 __tmp.put_u8(self.destination_system);
11889 __tmp.put_u8(self.log_levels);
11890 for val in &self.arguments {
11891 __tmp.put_u8(*val);
11892 }
11893 if matches!(version, MavlinkVersion::V2) {
11894 let len = __tmp.len();
11895 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11896 } else {
11897 __tmp.len()
11898 }
11899 }
11900}
11901#[doc = "id: 245"]
11902#[doc = "Provides state for additional features."]
11903#[derive(Debug, Clone, PartialEq)]
11904#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11905#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11906pub struct EXTENDED_SYS_STATE_DATA {
11907 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11908 pub vtol_state: MavVtolState,
11909 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11910 pub landed_state: MavLandedState,
11911}
11912impl EXTENDED_SYS_STATE_DATA {
11913 pub const ENCODED_LEN: usize = 2usize;
11914 pub const DEFAULT: Self = Self {
11915 vtol_state: MavVtolState::DEFAULT,
11916 landed_state: MavLandedState::DEFAULT,
11917 };
11918 #[cfg(feature = "arbitrary")]
11919 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11920 use arbitrary::{Arbitrary, Unstructured};
11921 let mut buf = [0u8; 1024];
11922 rng.fill_bytes(&mut buf);
11923 let mut unstructured = Unstructured::new(&buf);
11924 Self::arbitrary(&mut unstructured).unwrap_or_default()
11925 }
11926}
11927impl Default for EXTENDED_SYS_STATE_DATA {
11928 fn default() -> Self {
11929 Self::DEFAULT.clone()
11930 }
11931}
11932impl MessageData for EXTENDED_SYS_STATE_DATA {
11933 type Message = MavMessage;
11934 const ID: u32 = 245u32;
11935 const NAME: &'static str = "EXTENDED_SYS_STATE";
11936 const EXTRA_CRC: u8 = 130u8;
11937 const ENCODED_LEN: usize = 2usize;
11938 fn deser(
11939 _version: MavlinkVersion,
11940 __input: &[u8],
11941 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11942 let avail_len = __input.len();
11943 let mut payload_buf = [0; Self::ENCODED_LEN];
11944 let mut buf = if avail_len < Self::ENCODED_LEN {
11945 payload_buf[0..avail_len].copy_from_slice(__input);
11946 Bytes::new(&payload_buf)
11947 } else {
11948 Bytes::new(__input)
11949 };
11950 let mut __struct = Self::default();
11951 let tmp = buf.get_u8();
11952 __struct.vtol_state =
11953 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11954 enum_type: "MavVtolState",
11955 value: tmp as u32,
11956 })?;
11957 let tmp = buf.get_u8();
11958 __struct.landed_state =
11959 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11960 enum_type: "MavLandedState",
11961 value: tmp as u32,
11962 })?;
11963 Ok(__struct)
11964 }
11965 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11966 let mut __tmp = BytesMut::new(bytes);
11967 #[allow(clippy::absurd_extreme_comparisons)]
11968 #[allow(unused_comparisons)]
11969 if __tmp.remaining() < Self::ENCODED_LEN {
11970 panic!(
11971 "buffer is too small (need {} bytes, but got {})",
11972 Self::ENCODED_LEN,
11973 __tmp.remaining(),
11974 )
11975 }
11976 __tmp.put_u8(self.vtol_state as u8);
11977 __tmp.put_u8(self.landed_state as u8);
11978 if matches!(version, MavlinkVersion::V2) {
11979 let len = __tmp.len();
11980 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11981 } else {
11982 __tmp.len()
11983 }
11984 }
11985}
11986#[doc = "id: 162"]
11987#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11988#[derive(Debug, Clone, PartialEq)]
11989#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11991pub struct FENCE_STATUS_DATA {
11992 #[doc = "Time (since boot) of last breach."]
11993 pub breach_time: u32,
11994 #[doc = "Number of fence breaches."]
11995 pub breach_count: u16,
11996 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11997 pub breach_status: u8,
11998 #[doc = "Last breach type."]
11999 pub breach_type: FenceBreach,
12000 #[doc = "Active action to prevent fence breach"]
12001 #[cfg_attr(feature = "serde", serde(default))]
12002 pub breach_mitigation: FenceMitigate,
12003}
12004impl FENCE_STATUS_DATA {
12005 pub const ENCODED_LEN: usize = 9usize;
12006 pub const DEFAULT: Self = Self {
12007 breach_time: 0_u32,
12008 breach_count: 0_u16,
12009 breach_status: 0_u8,
12010 breach_type: FenceBreach::DEFAULT,
12011 breach_mitigation: FenceMitigate::DEFAULT,
12012 };
12013 #[cfg(feature = "arbitrary")]
12014 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12015 use arbitrary::{Arbitrary, Unstructured};
12016 let mut buf = [0u8; 1024];
12017 rng.fill_bytes(&mut buf);
12018 let mut unstructured = Unstructured::new(&buf);
12019 Self::arbitrary(&mut unstructured).unwrap_or_default()
12020 }
12021}
12022impl Default for FENCE_STATUS_DATA {
12023 fn default() -> Self {
12024 Self::DEFAULT.clone()
12025 }
12026}
12027impl MessageData for FENCE_STATUS_DATA {
12028 type Message = MavMessage;
12029 const ID: u32 = 162u32;
12030 const NAME: &'static str = "FENCE_STATUS";
12031 const EXTRA_CRC: u8 = 189u8;
12032 const ENCODED_LEN: usize = 9usize;
12033 fn deser(
12034 _version: MavlinkVersion,
12035 __input: &[u8],
12036 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12037 let avail_len = __input.len();
12038 let mut payload_buf = [0; Self::ENCODED_LEN];
12039 let mut buf = if avail_len < Self::ENCODED_LEN {
12040 payload_buf[0..avail_len].copy_from_slice(__input);
12041 Bytes::new(&payload_buf)
12042 } else {
12043 Bytes::new(__input)
12044 };
12045 let mut __struct = Self::default();
12046 __struct.breach_time = buf.get_u32_le();
12047 __struct.breach_count = buf.get_u16_le();
12048 __struct.breach_status = buf.get_u8();
12049 let tmp = buf.get_u8();
12050 __struct.breach_type =
12051 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12052 enum_type: "FenceBreach",
12053 value: tmp as u32,
12054 })?;
12055 let tmp = buf.get_u8();
12056 __struct.breach_mitigation =
12057 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12058 enum_type: "FenceMitigate",
12059 value: tmp as u32,
12060 })?;
12061 Ok(__struct)
12062 }
12063 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12064 let mut __tmp = BytesMut::new(bytes);
12065 #[allow(clippy::absurd_extreme_comparisons)]
12066 #[allow(unused_comparisons)]
12067 if __tmp.remaining() < Self::ENCODED_LEN {
12068 panic!(
12069 "buffer is too small (need {} bytes, but got {})",
12070 Self::ENCODED_LEN,
12071 __tmp.remaining(),
12072 )
12073 }
12074 __tmp.put_u32_le(self.breach_time);
12075 __tmp.put_u16_le(self.breach_count);
12076 __tmp.put_u8(self.breach_status);
12077 __tmp.put_u8(self.breach_type as u8);
12078 __tmp.put_u8(self.breach_mitigation as u8);
12079 if matches!(version, MavlinkVersion::V2) {
12080 let len = __tmp.len();
12081 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12082 } else {
12083 __tmp.len()
12084 }
12085 }
12086}
12087#[doc = "id: 110"]
12088#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
12089#[derive(Debug, Clone, PartialEq)]
12090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12091#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12092pub struct FILE_TRANSFER_PROTOCOL_DATA {
12093 #[doc = "Network ID (0 for broadcast)"]
12094 pub target_network: u8,
12095 #[doc = "System ID (0 for broadcast)"]
12096 pub target_system: u8,
12097 #[doc = "Component ID (0 for broadcast)"]
12098 pub target_component: u8,
12099 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
12100 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12101 pub payload: [u8; 251],
12102}
12103impl FILE_TRANSFER_PROTOCOL_DATA {
12104 pub const ENCODED_LEN: usize = 254usize;
12105 pub const DEFAULT: Self = Self {
12106 target_network: 0_u8,
12107 target_system: 0_u8,
12108 target_component: 0_u8,
12109 payload: [0_u8; 251usize],
12110 };
12111 #[cfg(feature = "arbitrary")]
12112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12113 use arbitrary::{Arbitrary, Unstructured};
12114 let mut buf = [0u8; 1024];
12115 rng.fill_bytes(&mut buf);
12116 let mut unstructured = Unstructured::new(&buf);
12117 Self::arbitrary(&mut unstructured).unwrap_or_default()
12118 }
12119}
12120impl Default for FILE_TRANSFER_PROTOCOL_DATA {
12121 fn default() -> Self {
12122 Self::DEFAULT.clone()
12123 }
12124}
12125impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
12126 type Message = MavMessage;
12127 const ID: u32 = 110u32;
12128 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
12129 const EXTRA_CRC: u8 = 84u8;
12130 const ENCODED_LEN: usize = 254usize;
12131 fn deser(
12132 _version: MavlinkVersion,
12133 __input: &[u8],
12134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12135 let avail_len = __input.len();
12136 let mut payload_buf = [0; Self::ENCODED_LEN];
12137 let mut buf = if avail_len < Self::ENCODED_LEN {
12138 payload_buf[0..avail_len].copy_from_slice(__input);
12139 Bytes::new(&payload_buf)
12140 } else {
12141 Bytes::new(__input)
12142 };
12143 let mut __struct = Self::default();
12144 __struct.target_network = buf.get_u8();
12145 __struct.target_system = buf.get_u8();
12146 __struct.target_component = buf.get_u8();
12147 for v in &mut __struct.payload {
12148 let val = buf.get_u8();
12149 *v = val;
12150 }
12151 Ok(__struct)
12152 }
12153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12154 let mut __tmp = BytesMut::new(bytes);
12155 #[allow(clippy::absurd_extreme_comparisons)]
12156 #[allow(unused_comparisons)]
12157 if __tmp.remaining() < Self::ENCODED_LEN {
12158 panic!(
12159 "buffer is too small (need {} bytes, but got {})",
12160 Self::ENCODED_LEN,
12161 __tmp.remaining(),
12162 )
12163 }
12164 __tmp.put_u8(self.target_network);
12165 __tmp.put_u8(self.target_system);
12166 __tmp.put_u8(self.target_component);
12167 for val in &self.payload {
12168 __tmp.put_u8(*val);
12169 }
12170 if matches!(version, MavlinkVersion::V2) {
12171 let len = __tmp.len();
12172 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12173 } else {
12174 __tmp.len()
12175 }
12176 }
12177}
12178#[doc = "id: 264"]
12179#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
12180#[derive(Debug, Clone, PartialEq)]
12181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12182#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12183pub struct FLIGHT_INFORMATION_DATA {
12184 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
12185 pub arming_time_utc: u64,
12186 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
12187 pub takeoff_time_utc: u64,
12188 #[doc = "Flight number. Note, field is misnamed UUID."]
12189 pub flight_uuid: u64,
12190 #[doc = "Timestamp (time since system boot)."]
12191 pub time_boot_ms: u32,
12192 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
12193 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12194 pub landing_time: u32,
12195}
12196impl FLIGHT_INFORMATION_DATA {
12197 pub const ENCODED_LEN: usize = 32usize;
12198 pub const DEFAULT: Self = Self {
12199 arming_time_utc: 0_u64,
12200 takeoff_time_utc: 0_u64,
12201 flight_uuid: 0_u64,
12202 time_boot_ms: 0_u32,
12203 landing_time: 0_u32,
12204 };
12205 #[cfg(feature = "arbitrary")]
12206 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12207 use arbitrary::{Arbitrary, Unstructured};
12208 let mut buf = [0u8; 1024];
12209 rng.fill_bytes(&mut buf);
12210 let mut unstructured = Unstructured::new(&buf);
12211 Self::arbitrary(&mut unstructured).unwrap_or_default()
12212 }
12213}
12214impl Default for FLIGHT_INFORMATION_DATA {
12215 fn default() -> Self {
12216 Self::DEFAULT.clone()
12217 }
12218}
12219impl MessageData for FLIGHT_INFORMATION_DATA {
12220 type Message = MavMessage;
12221 const ID: u32 = 264u32;
12222 const NAME: &'static str = "FLIGHT_INFORMATION";
12223 const EXTRA_CRC: u8 = 49u8;
12224 const ENCODED_LEN: usize = 32usize;
12225 fn deser(
12226 _version: MavlinkVersion,
12227 __input: &[u8],
12228 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12229 let avail_len = __input.len();
12230 let mut payload_buf = [0; Self::ENCODED_LEN];
12231 let mut buf = if avail_len < Self::ENCODED_LEN {
12232 payload_buf[0..avail_len].copy_from_slice(__input);
12233 Bytes::new(&payload_buf)
12234 } else {
12235 Bytes::new(__input)
12236 };
12237 let mut __struct = Self::default();
12238 __struct.arming_time_utc = buf.get_u64_le();
12239 __struct.takeoff_time_utc = buf.get_u64_le();
12240 __struct.flight_uuid = buf.get_u64_le();
12241 __struct.time_boot_ms = buf.get_u32_le();
12242 __struct.landing_time = buf.get_u32_le();
12243 Ok(__struct)
12244 }
12245 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12246 let mut __tmp = BytesMut::new(bytes);
12247 #[allow(clippy::absurd_extreme_comparisons)]
12248 #[allow(unused_comparisons)]
12249 if __tmp.remaining() < Self::ENCODED_LEN {
12250 panic!(
12251 "buffer is too small (need {} bytes, but got {})",
12252 Self::ENCODED_LEN,
12253 __tmp.remaining(),
12254 )
12255 }
12256 __tmp.put_u64_le(self.arming_time_utc);
12257 __tmp.put_u64_le(self.takeoff_time_utc);
12258 __tmp.put_u64_le(self.flight_uuid);
12259 __tmp.put_u32_le(self.time_boot_ms);
12260 __tmp.put_u32_le(self.landing_time);
12261 if matches!(version, MavlinkVersion::V2) {
12262 let len = __tmp.len();
12263 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12264 } else {
12265 __tmp.len()
12266 }
12267 }
12268}
12269#[doc = "id: 144"]
12270#[doc = "Current motion information from a designated system."]
12271#[derive(Debug, Clone, PartialEq)]
12272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12274pub struct FOLLOW_TARGET_DATA {
12275 #[doc = "Timestamp (time since system boot)."]
12276 pub timestamp: u64,
12277 #[doc = "button states or switches of a tracker device"]
12278 pub custom_state: u64,
12279 #[doc = "Latitude (WGS84)"]
12280 pub lat: i32,
12281 #[doc = "Longitude (WGS84)"]
12282 pub lon: i32,
12283 #[doc = "Altitude (MSL)"]
12284 pub alt: f32,
12285 #[doc = "target velocity (0,0,0) for unknown"]
12286 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12287 pub vel: [f32; 3],
12288 #[doc = "linear target acceleration (0,0,0) for unknown"]
12289 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12290 pub acc: [f32; 3],
12291 #[doc = "(0 0 0 0 for unknown)"]
12292 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12293 pub attitude_q: [f32; 4],
12294 #[doc = "(0 0 0 for unknown)"]
12295 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12296 pub rates: [f32; 3],
12297 #[doc = "eph epv"]
12298 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12299 pub position_cov: [f32; 3],
12300 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12301 pub est_capabilities: u8,
12302}
12303impl FOLLOW_TARGET_DATA {
12304 pub const ENCODED_LEN: usize = 93usize;
12305 pub const DEFAULT: Self = Self {
12306 timestamp: 0_u64,
12307 custom_state: 0_u64,
12308 lat: 0_i32,
12309 lon: 0_i32,
12310 alt: 0.0_f32,
12311 vel: [0.0_f32; 3usize],
12312 acc: [0.0_f32; 3usize],
12313 attitude_q: [0.0_f32; 4usize],
12314 rates: [0.0_f32; 3usize],
12315 position_cov: [0.0_f32; 3usize],
12316 est_capabilities: 0_u8,
12317 };
12318 #[cfg(feature = "arbitrary")]
12319 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12320 use arbitrary::{Arbitrary, Unstructured};
12321 let mut buf = [0u8; 1024];
12322 rng.fill_bytes(&mut buf);
12323 let mut unstructured = Unstructured::new(&buf);
12324 Self::arbitrary(&mut unstructured).unwrap_or_default()
12325 }
12326}
12327impl Default for FOLLOW_TARGET_DATA {
12328 fn default() -> Self {
12329 Self::DEFAULT.clone()
12330 }
12331}
12332impl MessageData for FOLLOW_TARGET_DATA {
12333 type Message = MavMessage;
12334 const ID: u32 = 144u32;
12335 const NAME: &'static str = "FOLLOW_TARGET";
12336 const EXTRA_CRC: u8 = 127u8;
12337 const ENCODED_LEN: usize = 93usize;
12338 fn deser(
12339 _version: MavlinkVersion,
12340 __input: &[u8],
12341 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12342 let avail_len = __input.len();
12343 let mut payload_buf = [0; Self::ENCODED_LEN];
12344 let mut buf = if avail_len < Self::ENCODED_LEN {
12345 payload_buf[0..avail_len].copy_from_slice(__input);
12346 Bytes::new(&payload_buf)
12347 } else {
12348 Bytes::new(__input)
12349 };
12350 let mut __struct = Self::default();
12351 __struct.timestamp = buf.get_u64_le();
12352 __struct.custom_state = buf.get_u64_le();
12353 __struct.lat = buf.get_i32_le();
12354 __struct.lon = buf.get_i32_le();
12355 __struct.alt = buf.get_f32_le();
12356 for v in &mut __struct.vel {
12357 let val = buf.get_f32_le();
12358 *v = val;
12359 }
12360 for v in &mut __struct.acc {
12361 let val = buf.get_f32_le();
12362 *v = val;
12363 }
12364 for v in &mut __struct.attitude_q {
12365 let val = buf.get_f32_le();
12366 *v = val;
12367 }
12368 for v in &mut __struct.rates {
12369 let val = buf.get_f32_le();
12370 *v = val;
12371 }
12372 for v in &mut __struct.position_cov {
12373 let val = buf.get_f32_le();
12374 *v = val;
12375 }
12376 __struct.est_capabilities = buf.get_u8();
12377 Ok(__struct)
12378 }
12379 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12380 let mut __tmp = BytesMut::new(bytes);
12381 #[allow(clippy::absurd_extreme_comparisons)]
12382 #[allow(unused_comparisons)]
12383 if __tmp.remaining() < Self::ENCODED_LEN {
12384 panic!(
12385 "buffer is too small (need {} bytes, but got {})",
12386 Self::ENCODED_LEN,
12387 __tmp.remaining(),
12388 )
12389 }
12390 __tmp.put_u64_le(self.timestamp);
12391 __tmp.put_u64_le(self.custom_state);
12392 __tmp.put_i32_le(self.lat);
12393 __tmp.put_i32_le(self.lon);
12394 __tmp.put_f32_le(self.alt);
12395 for val in &self.vel {
12396 __tmp.put_f32_le(*val);
12397 }
12398 for val in &self.acc {
12399 __tmp.put_f32_le(*val);
12400 }
12401 for val in &self.attitude_q {
12402 __tmp.put_f32_le(*val);
12403 }
12404 for val in &self.rates {
12405 __tmp.put_f32_le(*val);
12406 }
12407 for val in &self.position_cov {
12408 __tmp.put_f32_le(*val);
12409 }
12410 __tmp.put_u8(self.est_capabilities);
12411 if matches!(version, MavlinkVersion::V2) {
12412 let len = __tmp.len();
12413 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12414 } else {
12415 __tmp.len()
12416 }
12417 }
12418}
12419#[doc = "id: 371"]
12420#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12421#[derive(Debug, Clone, PartialEq)]
12422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12424pub struct FUEL_STATUS_DATA {
12425 #[doc = "Capacity when full. Must be provided."]
12426 pub maximum_fuel: f32,
12427 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12428 pub consumed_fuel: f32,
12429 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12430 pub remaining_fuel: f32,
12431 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12432 pub flow_rate: f32,
12433 #[doc = "Fuel temperature. NaN: field not provided."]
12434 pub temperature: f32,
12435 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12436 pub fuel_type: MavFuelType,
12437 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12438 pub id: u8,
12439 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12440 pub percent_remaining: u8,
12441}
12442impl FUEL_STATUS_DATA {
12443 pub const ENCODED_LEN: usize = 26usize;
12444 pub const DEFAULT: Self = Self {
12445 maximum_fuel: 0.0_f32,
12446 consumed_fuel: 0.0_f32,
12447 remaining_fuel: 0.0_f32,
12448 flow_rate: 0.0_f32,
12449 temperature: 0.0_f32,
12450 fuel_type: MavFuelType::DEFAULT,
12451 id: 0_u8,
12452 percent_remaining: 0_u8,
12453 };
12454 #[cfg(feature = "arbitrary")]
12455 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12456 use arbitrary::{Arbitrary, Unstructured};
12457 let mut buf = [0u8; 1024];
12458 rng.fill_bytes(&mut buf);
12459 let mut unstructured = Unstructured::new(&buf);
12460 Self::arbitrary(&mut unstructured).unwrap_or_default()
12461 }
12462}
12463impl Default for FUEL_STATUS_DATA {
12464 fn default() -> Self {
12465 Self::DEFAULT.clone()
12466 }
12467}
12468impl MessageData for FUEL_STATUS_DATA {
12469 type Message = MavMessage;
12470 const ID: u32 = 371u32;
12471 const NAME: &'static str = "FUEL_STATUS";
12472 const EXTRA_CRC: u8 = 10u8;
12473 const ENCODED_LEN: usize = 26usize;
12474 fn deser(
12475 _version: MavlinkVersion,
12476 __input: &[u8],
12477 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12478 let avail_len = __input.len();
12479 let mut payload_buf = [0; Self::ENCODED_LEN];
12480 let mut buf = if avail_len < Self::ENCODED_LEN {
12481 payload_buf[0..avail_len].copy_from_slice(__input);
12482 Bytes::new(&payload_buf)
12483 } else {
12484 Bytes::new(__input)
12485 };
12486 let mut __struct = Self::default();
12487 __struct.maximum_fuel = buf.get_f32_le();
12488 __struct.consumed_fuel = buf.get_f32_le();
12489 __struct.remaining_fuel = buf.get_f32_le();
12490 __struct.flow_rate = buf.get_f32_le();
12491 __struct.temperature = buf.get_f32_le();
12492 let tmp = buf.get_u32_le();
12493 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12494 ::mavlink_core::error::ParserError::InvalidEnum {
12495 enum_type: "MavFuelType",
12496 value: tmp as u32,
12497 },
12498 )?;
12499 __struct.id = buf.get_u8();
12500 __struct.percent_remaining = buf.get_u8();
12501 Ok(__struct)
12502 }
12503 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12504 let mut __tmp = BytesMut::new(bytes);
12505 #[allow(clippy::absurd_extreme_comparisons)]
12506 #[allow(unused_comparisons)]
12507 if __tmp.remaining() < Self::ENCODED_LEN {
12508 panic!(
12509 "buffer is too small (need {} bytes, but got {})",
12510 Self::ENCODED_LEN,
12511 __tmp.remaining(),
12512 )
12513 }
12514 __tmp.put_f32_le(self.maximum_fuel);
12515 __tmp.put_f32_le(self.consumed_fuel);
12516 __tmp.put_f32_le(self.remaining_fuel);
12517 __tmp.put_f32_le(self.flow_rate);
12518 __tmp.put_f32_le(self.temperature);
12519 __tmp.put_u32_le(self.fuel_type as u32);
12520 __tmp.put_u8(self.id);
12521 __tmp.put_u8(self.percent_remaining);
12522 if matches!(version, MavlinkVersion::V2) {
12523 let len = __tmp.len();
12524 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12525 } else {
12526 __tmp.len()
12527 }
12528 }
12529}
12530#[doc = "id: 8011"]
12531#[doc = "Fixed-wing soaring (i.e. thermal seeking) data."]
12532#[derive(Debug, Clone, PartialEq)]
12533#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12535pub struct FW_SOARING_DATA_DATA {
12536 #[doc = "Timestamp"]
12537 pub timestamp: u64,
12538 #[doc = "Timestamp since last mode change"]
12539 pub timestampModeChanged: u64,
12540 #[doc = "Thermal core updraft strength"]
12541 pub xW: f32,
12542 #[doc = "Thermal radius"]
12543 pub xR: f32,
12544 #[doc = "Thermal center latitude"]
12545 pub xLat: f32,
12546 #[doc = "Thermal center longitude"]
12547 pub xLon: f32,
12548 #[doc = "Variance W"]
12549 pub VarW: f32,
12550 #[doc = "Variance R"]
12551 pub VarR: f32,
12552 #[doc = "Variance Lat"]
12553 pub VarLat: f32,
12554 #[doc = "Variance Lon"]
12555 pub VarLon: f32,
12556 #[doc = "Suggested loiter radius"]
12557 pub LoiterRadius: f32,
12558 #[doc = "Suggested loiter direction"]
12559 pub LoiterDirection: f32,
12560 #[doc = "Distance to soar point"]
12561 pub DistToSoarPoint: f32,
12562 #[doc = "Expected sink rate at current airspeed, roll and throttle"]
12563 pub vSinkExp: f32,
12564 #[doc = "Measurement / updraft speed at current/local airplane position"]
12565 pub z1_LocalUpdraftSpeed: f32,
12566 #[doc = "Measurement / roll angle tracking error"]
12567 pub z2_DeltaRoll: f32,
12568 #[doc = "Expected measurement 1"]
12569 pub z1_exp: f32,
12570 #[doc = "Expected measurement 2"]
12571 pub z2_exp: f32,
12572 #[doc = "Thermal drift (from estimator prediction step only)"]
12573 pub ThermalGSNorth: f32,
12574 #[doc = "Thermal drift (from estimator prediction step only)"]
12575 pub ThermalGSEast: f32,
12576 #[doc = "Total specific energy change (filtered)"]
12577 pub TSE_dot: f32,
12578 #[doc = "Debug variable 1"]
12579 pub DebugVar1: f32,
12580 #[doc = "Debug variable 2"]
12581 pub DebugVar2: f32,
12582 #[doc = "Control Mode [-]"]
12583 pub ControlMode: u8,
12584 #[doc = "Data valid [-]"]
12585 pub valid: u8,
12586}
12587impl FW_SOARING_DATA_DATA {
12588 pub const ENCODED_LEN: usize = 102usize;
12589 pub const DEFAULT: Self = Self {
12590 timestamp: 0_u64,
12591 timestampModeChanged: 0_u64,
12592 xW: 0.0_f32,
12593 xR: 0.0_f32,
12594 xLat: 0.0_f32,
12595 xLon: 0.0_f32,
12596 VarW: 0.0_f32,
12597 VarR: 0.0_f32,
12598 VarLat: 0.0_f32,
12599 VarLon: 0.0_f32,
12600 LoiterRadius: 0.0_f32,
12601 LoiterDirection: 0.0_f32,
12602 DistToSoarPoint: 0.0_f32,
12603 vSinkExp: 0.0_f32,
12604 z1_LocalUpdraftSpeed: 0.0_f32,
12605 z2_DeltaRoll: 0.0_f32,
12606 z1_exp: 0.0_f32,
12607 z2_exp: 0.0_f32,
12608 ThermalGSNorth: 0.0_f32,
12609 ThermalGSEast: 0.0_f32,
12610 TSE_dot: 0.0_f32,
12611 DebugVar1: 0.0_f32,
12612 DebugVar2: 0.0_f32,
12613 ControlMode: 0_u8,
12614 valid: 0_u8,
12615 };
12616 #[cfg(feature = "arbitrary")]
12617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12618 use arbitrary::{Arbitrary, Unstructured};
12619 let mut buf = [0u8; 1024];
12620 rng.fill_bytes(&mut buf);
12621 let mut unstructured = Unstructured::new(&buf);
12622 Self::arbitrary(&mut unstructured).unwrap_or_default()
12623 }
12624}
12625impl Default for FW_SOARING_DATA_DATA {
12626 fn default() -> Self {
12627 Self::DEFAULT.clone()
12628 }
12629}
12630impl MessageData for FW_SOARING_DATA_DATA {
12631 type Message = MavMessage;
12632 const ID: u32 = 8011u32;
12633 const NAME: &'static str = "FW_SOARING_DATA";
12634 const EXTRA_CRC: u8 = 20u8;
12635 const ENCODED_LEN: usize = 102usize;
12636 fn deser(
12637 _version: MavlinkVersion,
12638 __input: &[u8],
12639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12640 let avail_len = __input.len();
12641 let mut payload_buf = [0; Self::ENCODED_LEN];
12642 let mut buf = if avail_len < Self::ENCODED_LEN {
12643 payload_buf[0..avail_len].copy_from_slice(__input);
12644 Bytes::new(&payload_buf)
12645 } else {
12646 Bytes::new(__input)
12647 };
12648 let mut __struct = Self::default();
12649 __struct.timestamp = buf.get_u64_le();
12650 __struct.timestampModeChanged = buf.get_u64_le();
12651 __struct.xW = buf.get_f32_le();
12652 __struct.xR = buf.get_f32_le();
12653 __struct.xLat = buf.get_f32_le();
12654 __struct.xLon = buf.get_f32_le();
12655 __struct.VarW = buf.get_f32_le();
12656 __struct.VarR = buf.get_f32_le();
12657 __struct.VarLat = buf.get_f32_le();
12658 __struct.VarLon = buf.get_f32_le();
12659 __struct.LoiterRadius = buf.get_f32_le();
12660 __struct.LoiterDirection = buf.get_f32_le();
12661 __struct.DistToSoarPoint = buf.get_f32_le();
12662 __struct.vSinkExp = buf.get_f32_le();
12663 __struct.z1_LocalUpdraftSpeed = buf.get_f32_le();
12664 __struct.z2_DeltaRoll = buf.get_f32_le();
12665 __struct.z1_exp = buf.get_f32_le();
12666 __struct.z2_exp = buf.get_f32_le();
12667 __struct.ThermalGSNorth = buf.get_f32_le();
12668 __struct.ThermalGSEast = buf.get_f32_le();
12669 __struct.TSE_dot = buf.get_f32_le();
12670 __struct.DebugVar1 = buf.get_f32_le();
12671 __struct.DebugVar2 = buf.get_f32_le();
12672 __struct.ControlMode = buf.get_u8();
12673 __struct.valid = buf.get_u8();
12674 Ok(__struct)
12675 }
12676 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12677 let mut __tmp = BytesMut::new(bytes);
12678 #[allow(clippy::absurd_extreme_comparisons)]
12679 #[allow(unused_comparisons)]
12680 if __tmp.remaining() < Self::ENCODED_LEN {
12681 panic!(
12682 "buffer is too small (need {} bytes, but got {})",
12683 Self::ENCODED_LEN,
12684 __tmp.remaining(),
12685 )
12686 }
12687 __tmp.put_u64_le(self.timestamp);
12688 __tmp.put_u64_le(self.timestampModeChanged);
12689 __tmp.put_f32_le(self.xW);
12690 __tmp.put_f32_le(self.xR);
12691 __tmp.put_f32_le(self.xLat);
12692 __tmp.put_f32_le(self.xLon);
12693 __tmp.put_f32_le(self.VarW);
12694 __tmp.put_f32_le(self.VarR);
12695 __tmp.put_f32_le(self.VarLat);
12696 __tmp.put_f32_le(self.VarLon);
12697 __tmp.put_f32_le(self.LoiterRadius);
12698 __tmp.put_f32_le(self.LoiterDirection);
12699 __tmp.put_f32_le(self.DistToSoarPoint);
12700 __tmp.put_f32_le(self.vSinkExp);
12701 __tmp.put_f32_le(self.z1_LocalUpdraftSpeed);
12702 __tmp.put_f32_le(self.z2_DeltaRoll);
12703 __tmp.put_f32_le(self.z1_exp);
12704 __tmp.put_f32_le(self.z2_exp);
12705 __tmp.put_f32_le(self.ThermalGSNorth);
12706 __tmp.put_f32_le(self.ThermalGSEast);
12707 __tmp.put_f32_le(self.TSE_dot);
12708 __tmp.put_f32_le(self.DebugVar1);
12709 __tmp.put_f32_le(self.DebugVar2);
12710 __tmp.put_u8(self.ControlMode);
12711 __tmp.put_u8(self.valid);
12712 if matches!(version, MavlinkVersion::V2) {
12713 let len = __tmp.len();
12714 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12715 } else {
12716 __tmp.len()
12717 }
12718 }
12719}
12720#[doc = "id: 373"]
12721#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12722#[derive(Debug, Clone, PartialEq)]
12723#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12724#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12725pub struct GENERATOR_STATUS_DATA {
12726 #[doc = "Status flags."]
12727 pub status: MavGeneratorStatusFlag,
12728 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12729 pub battery_current: f32,
12730 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12731 pub load_current: f32,
12732 #[doc = "The power being generated. NaN: field not provided"]
12733 pub power_generated: f32,
12734 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12735 pub bus_voltage: f32,
12736 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12737 pub bat_current_setpoint: f32,
12738 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12739 pub runtime: u32,
12740 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12741 pub time_until_maintenance: i32,
12742 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12743 pub generator_speed: u16,
12744 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12745 pub rectifier_temperature: i16,
12746 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12747 pub generator_temperature: i16,
12748}
12749impl GENERATOR_STATUS_DATA {
12750 pub const ENCODED_LEN: usize = 42usize;
12751 pub const DEFAULT: Self = Self {
12752 status: MavGeneratorStatusFlag::DEFAULT,
12753 battery_current: 0.0_f32,
12754 load_current: 0.0_f32,
12755 power_generated: 0.0_f32,
12756 bus_voltage: 0.0_f32,
12757 bat_current_setpoint: 0.0_f32,
12758 runtime: 0_u32,
12759 time_until_maintenance: 0_i32,
12760 generator_speed: 0_u16,
12761 rectifier_temperature: 0_i16,
12762 generator_temperature: 0_i16,
12763 };
12764 #[cfg(feature = "arbitrary")]
12765 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12766 use arbitrary::{Arbitrary, Unstructured};
12767 let mut buf = [0u8; 1024];
12768 rng.fill_bytes(&mut buf);
12769 let mut unstructured = Unstructured::new(&buf);
12770 Self::arbitrary(&mut unstructured).unwrap_or_default()
12771 }
12772}
12773impl Default for GENERATOR_STATUS_DATA {
12774 fn default() -> Self {
12775 Self::DEFAULT.clone()
12776 }
12777}
12778impl MessageData for GENERATOR_STATUS_DATA {
12779 type Message = MavMessage;
12780 const ID: u32 = 373u32;
12781 const NAME: &'static str = "GENERATOR_STATUS";
12782 const EXTRA_CRC: u8 = 117u8;
12783 const ENCODED_LEN: usize = 42usize;
12784 fn deser(
12785 _version: MavlinkVersion,
12786 __input: &[u8],
12787 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12788 let avail_len = __input.len();
12789 let mut payload_buf = [0; Self::ENCODED_LEN];
12790 let mut buf = if avail_len < Self::ENCODED_LEN {
12791 payload_buf[0..avail_len].copy_from_slice(__input);
12792 Bytes::new(&payload_buf)
12793 } else {
12794 Bytes::new(__input)
12795 };
12796 let mut __struct = Self::default();
12797 let tmp = buf.get_u64_le();
12798 __struct.status = MavGeneratorStatusFlag::from_bits(
12799 tmp & MavGeneratorStatusFlag::all().bits(),
12800 )
12801 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12802 flag_type: "MavGeneratorStatusFlag",
12803 value: tmp as u32,
12804 })?;
12805 __struct.battery_current = buf.get_f32_le();
12806 __struct.load_current = buf.get_f32_le();
12807 __struct.power_generated = buf.get_f32_le();
12808 __struct.bus_voltage = buf.get_f32_le();
12809 __struct.bat_current_setpoint = buf.get_f32_le();
12810 __struct.runtime = buf.get_u32_le();
12811 __struct.time_until_maintenance = buf.get_i32_le();
12812 __struct.generator_speed = buf.get_u16_le();
12813 __struct.rectifier_temperature = buf.get_i16_le();
12814 __struct.generator_temperature = buf.get_i16_le();
12815 Ok(__struct)
12816 }
12817 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12818 let mut __tmp = BytesMut::new(bytes);
12819 #[allow(clippy::absurd_extreme_comparisons)]
12820 #[allow(unused_comparisons)]
12821 if __tmp.remaining() < Self::ENCODED_LEN {
12822 panic!(
12823 "buffer is too small (need {} bytes, but got {})",
12824 Self::ENCODED_LEN,
12825 __tmp.remaining(),
12826 )
12827 }
12828 __tmp.put_u64_le(self.status.bits());
12829 __tmp.put_f32_le(self.battery_current);
12830 __tmp.put_f32_le(self.load_current);
12831 __tmp.put_f32_le(self.power_generated);
12832 __tmp.put_f32_le(self.bus_voltage);
12833 __tmp.put_f32_le(self.bat_current_setpoint);
12834 __tmp.put_u32_le(self.runtime);
12835 __tmp.put_i32_le(self.time_until_maintenance);
12836 __tmp.put_u16_le(self.generator_speed);
12837 __tmp.put_i16_le(self.rectifier_temperature);
12838 __tmp.put_i16_le(self.generator_temperature);
12839 if matches!(version, MavlinkVersion::V2) {
12840 let len = __tmp.len();
12841 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12842 } else {
12843 __tmp.len()
12844 }
12845 }
12846}
12847#[doc = "id: 285"]
12848#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12849#[derive(Debug, Clone, PartialEq)]
12850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12852pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12853 #[doc = "Timestamp (time since system boot)."]
12854 pub time_boot_ms: u32,
12855 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12856 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12857 pub q: [f32; 4],
12858 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12859 pub angular_velocity_x: f32,
12860 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12861 pub angular_velocity_y: f32,
12862 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12863 pub angular_velocity_z: f32,
12864 #[doc = "Failure flags (0 for no failure)"]
12865 pub failure_flags: GimbalDeviceErrorFlags,
12866 #[doc = "Current gimbal flags set."]
12867 pub flags: GimbalDeviceFlags,
12868 #[doc = "System ID"]
12869 pub target_system: u8,
12870 #[doc = "Component ID"]
12871 pub target_component: u8,
12872 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12873 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12874 pub delta_yaw: f32,
12875 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12876 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12877 pub delta_yaw_velocity: f32,
12878 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12879 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12880 pub gimbal_device_id: u8,
12881}
12882impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12883 pub const ENCODED_LEN: usize = 49usize;
12884 pub const DEFAULT: Self = Self {
12885 time_boot_ms: 0_u32,
12886 q: [0.0_f32; 4usize],
12887 angular_velocity_x: 0.0_f32,
12888 angular_velocity_y: 0.0_f32,
12889 angular_velocity_z: 0.0_f32,
12890 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12891 flags: GimbalDeviceFlags::DEFAULT,
12892 target_system: 0_u8,
12893 target_component: 0_u8,
12894 delta_yaw: 0.0_f32,
12895 delta_yaw_velocity: 0.0_f32,
12896 gimbal_device_id: 0_u8,
12897 };
12898 #[cfg(feature = "arbitrary")]
12899 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12900 use arbitrary::{Arbitrary, Unstructured};
12901 let mut buf = [0u8; 1024];
12902 rng.fill_bytes(&mut buf);
12903 let mut unstructured = Unstructured::new(&buf);
12904 Self::arbitrary(&mut unstructured).unwrap_or_default()
12905 }
12906}
12907impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12908 fn default() -> Self {
12909 Self::DEFAULT.clone()
12910 }
12911}
12912impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12913 type Message = MavMessage;
12914 const ID: u32 = 285u32;
12915 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12916 const EXTRA_CRC: u8 = 137u8;
12917 const ENCODED_LEN: usize = 49usize;
12918 fn deser(
12919 _version: MavlinkVersion,
12920 __input: &[u8],
12921 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12922 let avail_len = __input.len();
12923 let mut payload_buf = [0; Self::ENCODED_LEN];
12924 let mut buf = if avail_len < Self::ENCODED_LEN {
12925 payload_buf[0..avail_len].copy_from_slice(__input);
12926 Bytes::new(&payload_buf)
12927 } else {
12928 Bytes::new(__input)
12929 };
12930 let mut __struct = Self::default();
12931 __struct.time_boot_ms = buf.get_u32_le();
12932 for v in &mut __struct.q {
12933 let val = buf.get_f32_le();
12934 *v = val;
12935 }
12936 __struct.angular_velocity_x = buf.get_f32_le();
12937 __struct.angular_velocity_y = buf.get_f32_le();
12938 __struct.angular_velocity_z = buf.get_f32_le();
12939 let tmp = buf.get_u32_le();
12940 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12941 tmp & GimbalDeviceErrorFlags::all().bits(),
12942 )
12943 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12944 flag_type: "GimbalDeviceErrorFlags",
12945 value: tmp as u32,
12946 })?;
12947 let tmp = buf.get_u16_le();
12948 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12949 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12950 flag_type: "GimbalDeviceFlags",
12951 value: tmp as u32,
12952 })?;
12953 __struct.target_system = buf.get_u8();
12954 __struct.target_component = buf.get_u8();
12955 __struct.delta_yaw = buf.get_f32_le();
12956 __struct.delta_yaw_velocity = buf.get_f32_le();
12957 __struct.gimbal_device_id = buf.get_u8();
12958 Ok(__struct)
12959 }
12960 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12961 let mut __tmp = BytesMut::new(bytes);
12962 #[allow(clippy::absurd_extreme_comparisons)]
12963 #[allow(unused_comparisons)]
12964 if __tmp.remaining() < Self::ENCODED_LEN {
12965 panic!(
12966 "buffer is too small (need {} bytes, but got {})",
12967 Self::ENCODED_LEN,
12968 __tmp.remaining(),
12969 )
12970 }
12971 __tmp.put_u32_le(self.time_boot_ms);
12972 for val in &self.q {
12973 __tmp.put_f32_le(*val);
12974 }
12975 __tmp.put_f32_le(self.angular_velocity_x);
12976 __tmp.put_f32_le(self.angular_velocity_y);
12977 __tmp.put_f32_le(self.angular_velocity_z);
12978 __tmp.put_u32_le(self.failure_flags.bits());
12979 __tmp.put_u16_le(self.flags.bits());
12980 __tmp.put_u8(self.target_system);
12981 __tmp.put_u8(self.target_component);
12982 __tmp.put_f32_le(self.delta_yaw);
12983 __tmp.put_f32_le(self.delta_yaw_velocity);
12984 __tmp.put_u8(self.gimbal_device_id);
12985 if matches!(version, MavlinkVersion::V2) {
12986 let len = __tmp.len();
12987 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12988 } else {
12989 __tmp.len()
12990 }
12991 }
12992}
12993#[doc = "id: 283"]
12994#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12995#[derive(Debug, Clone, PartialEq)]
12996#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12997#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12998pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12999 #[doc = "UID of gimbal hardware (0 if unknown)."]
13000 pub uid: u64,
13001 #[doc = "Timestamp (time since system boot)."]
13002 pub time_boot_ms: u32,
13003 #[doc = "0xff)."]
13004 pub firmware_version: u32,
13005 #[doc = "0xff)."]
13006 pub hardware_version: u32,
13007 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13008 pub roll_min: f32,
13009 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13010 pub roll_max: f32,
13011 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13012 pub pitch_min: f32,
13013 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13014 pub pitch_max: f32,
13015 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13016 pub yaw_min: f32,
13017 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13018 pub yaw_max: f32,
13019 #[doc = "Bitmap of gimbal capability flags."]
13020 pub cap_flags: GimbalDeviceCapFlags,
13021 #[doc = "Bitmap for use for gimbal-specific capability flags."]
13022 pub custom_cap_flags: u16,
13023 #[doc = "Name of the gimbal vendor."]
13024 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13025 pub vendor_name: [u8; 32],
13026 #[doc = "Name of the gimbal model."]
13027 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13028 pub model_name: [u8; 32],
13029 #[doc = "Custom name of the gimbal given to it by the user."]
13030 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13031 pub custom_name: [u8; 32],
13032 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13033 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13034 pub gimbal_device_id: u8,
13035}
13036impl GIMBAL_DEVICE_INFORMATION_DATA {
13037 pub const ENCODED_LEN: usize = 145usize;
13038 pub const DEFAULT: Self = Self {
13039 uid: 0_u64,
13040 time_boot_ms: 0_u32,
13041 firmware_version: 0_u32,
13042 hardware_version: 0_u32,
13043 roll_min: 0.0_f32,
13044 roll_max: 0.0_f32,
13045 pitch_min: 0.0_f32,
13046 pitch_max: 0.0_f32,
13047 yaw_min: 0.0_f32,
13048 yaw_max: 0.0_f32,
13049 cap_flags: GimbalDeviceCapFlags::DEFAULT,
13050 custom_cap_flags: 0_u16,
13051 vendor_name: [0_u8; 32usize],
13052 model_name: [0_u8; 32usize],
13053 custom_name: [0_u8; 32usize],
13054 gimbal_device_id: 0_u8,
13055 };
13056 #[cfg(feature = "arbitrary")]
13057 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13058 use arbitrary::{Arbitrary, Unstructured};
13059 let mut buf = [0u8; 1024];
13060 rng.fill_bytes(&mut buf);
13061 let mut unstructured = Unstructured::new(&buf);
13062 Self::arbitrary(&mut unstructured).unwrap_or_default()
13063 }
13064}
13065impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
13066 fn default() -> Self {
13067 Self::DEFAULT.clone()
13068 }
13069}
13070impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
13071 type Message = MavMessage;
13072 const ID: u32 = 283u32;
13073 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
13074 const EXTRA_CRC: u8 = 74u8;
13075 const ENCODED_LEN: usize = 145usize;
13076 fn deser(
13077 _version: MavlinkVersion,
13078 __input: &[u8],
13079 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13080 let avail_len = __input.len();
13081 let mut payload_buf = [0; Self::ENCODED_LEN];
13082 let mut buf = if avail_len < Self::ENCODED_LEN {
13083 payload_buf[0..avail_len].copy_from_slice(__input);
13084 Bytes::new(&payload_buf)
13085 } else {
13086 Bytes::new(__input)
13087 };
13088 let mut __struct = Self::default();
13089 __struct.uid = buf.get_u64_le();
13090 __struct.time_boot_ms = buf.get_u32_le();
13091 __struct.firmware_version = buf.get_u32_le();
13092 __struct.hardware_version = buf.get_u32_le();
13093 __struct.roll_min = buf.get_f32_le();
13094 __struct.roll_max = buf.get_f32_le();
13095 __struct.pitch_min = buf.get_f32_le();
13096 __struct.pitch_max = buf.get_f32_le();
13097 __struct.yaw_min = buf.get_f32_le();
13098 __struct.yaw_max = buf.get_f32_le();
13099 let tmp = buf.get_u16_le();
13100 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
13101 tmp & GimbalDeviceCapFlags::all().bits(),
13102 )
13103 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13104 flag_type: "GimbalDeviceCapFlags",
13105 value: tmp as u32,
13106 })?;
13107 __struct.custom_cap_flags = buf.get_u16_le();
13108 for v in &mut __struct.vendor_name {
13109 let val = buf.get_u8();
13110 *v = val;
13111 }
13112 for v in &mut __struct.model_name {
13113 let val = buf.get_u8();
13114 *v = val;
13115 }
13116 for v in &mut __struct.custom_name {
13117 let val = buf.get_u8();
13118 *v = val;
13119 }
13120 __struct.gimbal_device_id = buf.get_u8();
13121 Ok(__struct)
13122 }
13123 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13124 let mut __tmp = BytesMut::new(bytes);
13125 #[allow(clippy::absurd_extreme_comparisons)]
13126 #[allow(unused_comparisons)]
13127 if __tmp.remaining() < Self::ENCODED_LEN {
13128 panic!(
13129 "buffer is too small (need {} bytes, but got {})",
13130 Self::ENCODED_LEN,
13131 __tmp.remaining(),
13132 )
13133 }
13134 __tmp.put_u64_le(self.uid);
13135 __tmp.put_u32_le(self.time_boot_ms);
13136 __tmp.put_u32_le(self.firmware_version);
13137 __tmp.put_u32_le(self.hardware_version);
13138 __tmp.put_f32_le(self.roll_min);
13139 __tmp.put_f32_le(self.roll_max);
13140 __tmp.put_f32_le(self.pitch_min);
13141 __tmp.put_f32_le(self.pitch_max);
13142 __tmp.put_f32_le(self.yaw_min);
13143 __tmp.put_f32_le(self.yaw_max);
13144 __tmp.put_u16_le(self.cap_flags.bits());
13145 __tmp.put_u16_le(self.custom_cap_flags);
13146 for val in &self.vendor_name {
13147 __tmp.put_u8(*val);
13148 }
13149 for val in &self.model_name {
13150 __tmp.put_u8(*val);
13151 }
13152 for val in &self.custom_name {
13153 __tmp.put_u8(*val);
13154 }
13155 __tmp.put_u8(self.gimbal_device_id);
13156 if matches!(version, MavlinkVersion::V2) {
13157 let len = __tmp.len();
13158 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13159 } else {
13160 __tmp.len()
13161 }
13162 }
13163}
13164#[doc = "id: 284"]
13165#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
13166#[derive(Debug, Clone, PartialEq)]
13167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13169pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13170 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
13171 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13172 pub q: [f32; 4],
13173 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
13174 pub angular_velocity_x: f32,
13175 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
13176 pub angular_velocity_y: f32,
13177 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
13178 pub angular_velocity_z: f32,
13179 #[doc = "Low level gimbal flags."]
13180 pub flags: GimbalDeviceFlags,
13181 #[doc = "System ID"]
13182 pub target_system: u8,
13183 #[doc = "Component ID"]
13184 pub target_component: u8,
13185}
13186impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13187 pub const ENCODED_LEN: usize = 32usize;
13188 pub const DEFAULT: Self = Self {
13189 q: [0.0_f32; 4usize],
13190 angular_velocity_x: 0.0_f32,
13191 angular_velocity_y: 0.0_f32,
13192 angular_velocity_z: 0.0_f32,
13193 flags: GimbalDeviceFlags::DEFAULT,
13194 target_system: 0_u8,
13195 target_component: 0_u8,
13196 };
13197 #[cfg(feature = "arbitrary")]
13198 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13199 use arbitrary::{Arbitrary, Unstructured};
13200 let mut buf = [0u8; 1024];
13201 rng.fill_bytes(&mut buf);
13202 let mut unstructured = Unstructured::new(&buf);
13203 Self::arbitrary(&mut unstructured).unwrap_or_default()
13204 }
13205}
13206impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13207 fn default() -> Self {
13208 Self::DEFAULT.clone()
13209 }
13210}
13211impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13212 type Message = MavMessage;
13213 const ID: u32 = 284u32;
13214 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
13215 const EXTRA_CRC: u8 = 99u8;
13216 const ENCODED_LEN: usize = 32usize;
13217 fn deser(
13218 _version: MavlinkVersion,
13219 __input: &[u8],
13220 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13221 let avail_len = __input.len();
13222 let mut payload_buf = [0; Self::ENCODED_LEN];
13223 let mut buf = if avail_len < Self::ENCODED_LEN {
13224 payload_buf[0..avail_len].copy_from_slice(__input);
13225 Bytes::new(&payload_buf)
13226 } else {
13227 Bytes::new(__input)
13228 };
13229 let mut __struct = Self::default();
13230 for v in &mut __struct.q {
13231 let val = buf.get_f32_le();
13232 *v = val;
13233 }
13234 __struct.angular_velocity_x = buf.get_f32_le();
13235 __struct.angular_velocity_y = buf.get_f32_le();
13236 __struct.angular_velocity_z = buf.get_f32_le();
13237 let tmp = buf.get_u16_le();
13238 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
13239 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13240 flag_type: "GimbalDeviceFlags",
13241 value: tmp as u32,
13242 })?;
13243 __struct.target_system = buf.get_u8();
13244 __struct.target_component = buf.get_u8();
13245 Ok(__struct)
13246 }
13247 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13248 let mut __tmp = BytesMut::new(bytes);
13249 #[allow(clippy::absurd_extreme_comparisons)]
13250 #[allow(unused_comparisons)]
13251 if __tmp.remaining() < Self::ENCODED_LEN {
13252 panic!(
13253 "buffer is too small (need {} bytes, but got {})",
13254 Self::ENCODED_LEN,
13255 __tmp.remaining(),
13256 )
13257 }
13258 for val in &self.q {
13259 __tmp.put_f32_le(*val);
13260 }
13261 __tmp.put_f32_le(self.angular_velocity_x);
13262 __tmp.put_f32_le(self.angular_velocity_y);
13263 __tmp.put_f32_le(self.angular_velocity_z);
13264 __tmp.put_u16_le(self.flags.bits());
13265 __tmp.put_u8(self.target_system);
13266 __tmp.put_u8(self.target_component);
13267 if matches!(version, MavlinkVersion::V2) {
13268 let len = __tmp.len();
13269 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13270 } else {
13271 __tmp.len()
13272 }
13273 }
13274}
13275#[doc = "id: 280"]
13276#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
13277#[derive(Debug, Clone, PartialEq)]
13278#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13280pub struct GIMBAL_MANAGER_INFORMATION_DATA {
13281 #[doc = "Timestamp (time since system boot)."]
13282 pub time_boot_ms: u32,
13283 #[doc = "Bitmap of gimbal capability flags."]
13284 pub cap_flags: GimbalManagerCapFlags,
13285 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13286 pub roll_min: f32,
13287 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13288 pub roll_max: f32,
13289 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
13290 pub pitch_min: f32,
13291 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
13292 pub pitch_max: f32,
13293 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
13294 pub yaw_min: f32,
13295 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
13296 pub yaw_max: f32,
13297 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13298 pub gimbal_device_id: u8,
13299}
13300impl GIMBAL_MANAGER_INFORMATION_DATA {
13301 pub const ENCODED_LEN: usize = 33usize;
13302 pub const DEFAULT: Self = Self {
13303 time_boot_ms: 0_u32,
13304 cap_flags: GimbalManagerCapFlags::DEFAULT,
13305 roll_min: 0.0_f32,
13306 roll_max: 0.0_f32,
13307 pitch_min: 0.0_f32,
13308 pitch_max: 0.0_f32,
13309 yaw_min: 0.0_f32,
13310 yaw_max: 0.0_f32,
13311 gimbal_device_id: 0_u8,
13312 };
13313 #[cfg(feature = "arbitrary")]
13314 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13315 use arbitrary::{Arbitrary, Unstructured};
13316 let mut buf = [0u8; 1024];
13317 rng.fill_bytes(&mut buf);
13318 let mut unstructured = Unstructured::new(&buf);
13319 Self::arbitrary(&mut unstructured).unwrap_or_default()
13320 }
13321}
13322impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
13323 fn default() -> Self {
13324 Self::DEFAULT.clone()
13325 }
13326}
13327impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
13328 type Message = MavMessage;
13329 const ID: u32 = 280u32;
13330 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
13331 const EXTRA_CRC: u8 = 70u8;
13332 const ENCODED_LEN: usize = 33usize;
13333 fn deser(
13334 _version: MavlinkVersion,
13335 __input: &[u8],
13336 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13337 let avail_len = __input.len();
13338 let mut payload_buf = [0; Self::ENCODED_LEN];
13339 let mut buf = if avail_len < Self::ENCODED_LEN {
13340 payload_buf[0..avail_len].copy_from_slice(__input);
13341 Bytes::new(&payload_buf)
13342 } else {
13343 Bytes::new(__input)
13344 };
13345 let mut __struct = Self::default();
13346 __struct.time_boot_ms = buf.get_u32_le();
13347 let tmp = buf.get_u32_le();
13348 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
13349 tmp & GimbalManagerCapFlags::all().bits(),
13350 )
13351 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13352 flag_type: "GimbalManagerCapFlags",
13353 value: tmp as u32,
13354 })?;
13355 __struct.roll_min = buf.get_f32_le();
13356 __struct.roll_max = buf.get_f32_le();
13357 __struct.pitch_min = buf.get_f32_le();
13358 __struct.pitch_max = buf.get_f32_le();
13359 __struct.yaw_min = buf.get_f32_le();
13360 __struct.yaw_max = buf.get_f32_le();
13361 __struct.gimbal_device_id = buf.get_u8();
13362 Ok(__struct)
13363 }
13364 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13365 let mut __tmp = BytesMut::new(bytes);
13366 #[allow(clippy::absurd_extreme_comparisons)]
13367 #[allow(unused_comparisons)]
13368 if __tmp.remaining() < Self::ENCODED_LEN {
13369 panic!(
13370 "buffer is too small (need {} bytes, but got {})",
13371 Self::ENCODED_LEN,
13372 __tmp.remaining(),
13373 )
13374 }
13375 __tmp.put_u32_le(self.time_boot_ms);
13376 __tmp.put_u32_le(self.cap_flags.bits());
13377 __tmp.put_f32_le(self.roll_min);
13378 __tmp.put_f32_le(self.roll_max);
13379 __tmp.put_f32_le(self.pitch_min);
13380 __tmp.put_f32_le(self.pitch_max);
13381 __tmp.put_f32_le(self.yaw_min);
13382 __tmp.put_f32_le(self.yaw_max);
13383 __tmp.put_u8(self.gimbal_device_id);
13384 if matches!(version, MavlinkVersion::V2) {
13385 let len = __tmp.len();
13386 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13387 } else {
13388 __tmp.len()
13389 }
13390 }
13391}
13392#[doc = "id: 282"]
13393#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13394#[derive(Debug, Clone, PartialEq)]
13395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13397pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13398 #[doc = "High level gimbal manager flags to use."]
13399 pub flags: GimbalManagerFlags,
13400 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13401 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13402 pub q: [f32; 4],
13403 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13404 pub angular_velocity_x: f32,
13405 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13406 pub angular_velocity_y: f32,
13407 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13408 pub angular_velocity_z: f32,
13409 #[doc = "System ID"]
13410 pub target_system: u8,
13411 #[doc = "Component ID"]
13412 pub target_component: u8,
13413 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13414 pub gimbal_device_id: u8,
13415}
13416impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13417 pub const ENCODED_LEN: usize = 35usize;
13418 pub const DEFAULT: Self = Self {
13419 flags: GimbalManagerFlags::DEFAULT,
13420 q: [0.0_f32; 4usize],
13421 angular_velocity_x: 0.0_f32,
13422 angular_velocity_y: 0.0_f32,
13423 angular_velocity_z: 0.0_f32,
13424 target_system: 0_u8,
13425 target_component: 0_u8,
13426 gimbal_device_id: 0_u8,
13427 };
13428 #[cfg(feature = "arbitrary")]
13429 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13430 use arbitrary::{Arbitrary, Unstructured};
13431 let mut buf = [0u8; 1024];
13432 rng.fill_bytes(&mut buf);
13433 let mut unstructured = Unstructured::new(&buf);
13434 Self::arbitrary(&mut unstructured).unwrap_or_default()
13435 }
13436}
13437impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13438 fn default() -> Self {
13439 Self::DEFAULT.clone()
13440 }
13441}
13442impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13443 type Message = MavMessage;
13444 const ID: u32 = 282u32;
13445 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13446 const EXTRA_CRC: u8 = 123u8;
13447 const ENCODED_LEN: usize = 35usize;
13448 fn deser(
13449 _version: MavlinkVersion,
13450 __input: &[u8],
13451 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13452 let avail_len = __input.len();
13453 let mut payload_buf = [0; Self::ENCODED_LEN];
13454 let mut buf = if avail_len < Self::ENCODED_LEN {
13455 payload_buf[0..avail_len].copy_from_slice(__input);
13456 Bytes::new(&payload_buf)
13457 } else {
13458 Bytes::new(__input)
13459 };
13460 let mut __struct = Self::default();
13461 let tmp = buf.get_u32_le();
13462 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13463 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13464 flag_type: "GimbalManagerFlags",
13465 value: tmp as u32,
13466 })?;
13467 for v in &mut __struct.q {
13468 let val = buf.get_f32_le();
13469 *v = val;
13470 }
13471 __struct.angular_velocity_x = buf.get_f32_le();
13472 __struct.angular_velocity_y = buf.get_f32_le();
13473 __struct.angular_velocity_z = buf.get_f32_le();
13474 __struct.target_system = buf.get_u8();
13475 __struct.target_component = buf.get_u8();
13476 __struct.gimbal_device_id = buf.get_u8();
13477 Ok(__struct)
13478 }
13479 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13480 let mut __tmp = BytesMut::new(bytes);
13481 #[allow(clippy::absurd_extreme_comparisons)]
13482 #[allow(unused_comparisons)]
13483 if __tmp.remaining() < Self::ENCODED_LEN {
13484 panic!(
13485 "buffer is too small (need {} bytes, but got {})",
13486 Self::ENCODED_LEN,
13487 __tmp.remaining(),
13488 )
13489 }
13490 __tmp.put_u32_le(self.flags.bits());
13491 for val in &self.q {
13492 __tmp.put_f32_le(*val);
13493 }
13494 __tmp.put_f32_le(self.angular_velocity_x);
13495 __tmp.put_f32_le(self.angular_velocity_y);
13496 __tmp.put_f32_le(self.angular_velocity_z);
13497 __tmp.put_u8(self.target_system);
13498 __tmp.put_u8(self.target_component);
13499 __tmp.put_u8(self.gimbal_device_id);
13500 if matches!(version, MavlinkVersion::V2) {
13501 let len = __tmp.len();
13502 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13503 } else {
13504 __tmp.len()
13505 }
13506 }
13507}
13508#[doc = "id: 288"]
13509#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13510#[derive(Debug, Clone, PartialEq)]
13511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13513pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13514 #[doc = "High level gimbal manager flags."]
13515 pub flags: GimbalManagerFlags,
13516 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13517 pub pitch: f32,
13518 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13519 pub yaw: f32,
13520 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13521 pub pitch_rate: f32,
13522 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13523 pub yaw_rate: f32,
13524 #[doc = "System ID"]
13525 pub target_system: u8,
13526 #[doc = "Component ID"]
13527 pub target_component: u8,
13528 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13529 pub gimbal_device_id: u8,
13530}
13531impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13532 pub const ENCODED_LEN: usize = 23usize;
13533 pub const DEFAULT: Self = Self {
13534 flags: GimbalManagerFlags::DEFAULT,
13535 pitch: 0.0_f32,
13536 yaw: 0.0_f32,
13537 pitch_rate: 0.0_f32,
13538 yaw_rate: 0.0_f32,
13539 target_system: 0_u8,
13540 target_component: 0_u8,
13541 gimbal_device_id: 0_u8,
13542 };
13543 #[cfg(feature = "arbitrary")]
13544 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13545 use arbitrary::{Arbitrary, Unstructured};
13546 let mut buf = [0u8; 1024];
13547 rng.fill_bytes(&mut buf);
13548 let mut unstructured = Unstructured::new(&buf);
13549 Self::arbitrary(&mut unstructured).unwrap_or_default()
13550 }
13551}
13552impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13553 fn default() -> Self {
13554 Self::DEFAULT.clone()
13555 }
13556}
13557impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13558 type Message = MavMessage;
13559 const ID: u32 = 288u32;
13560 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13561 const EXTRA_CRC: u8 = 20u8;
13562 const ENCODED_LEN: usize = 23usize;
13563 fn deser(
13564 _version: MavlinkVersion,
13565 __input: &[u8],
13566 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13567 let avail_len = __input.len();
13568 let mut payload_buf = [0; Self::ENCODED_LEN];
13569 let mut buf = if avail_len < Self::ENCODED_LEN {
13570 payload_buf[0..avail_len].copy_from_slice(__input);
13571 Bytes::new(&payload_buf)
13572 } else {
13573 Bytes::new(__input)
13574 };
13575 let mut __struct = Self::default();
13576 let tmp = buf.get_u32_le();
13577 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13578 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13579 flag_type: "GimbalManagerFlags",
13580 value: tmp as u32,
13581 })?;
13582 __struct.pitch = buf.get_f32_le();
13583 __struct.yaw = buf.get_f32_le();
13584 __struct.pitch_rate = buf.get_f32_le();
13585 __struct.yaw_rate = buf.get_f32_le();
13586 __struct.target_system = buf.get_u8();
13587 __struct.target_component = buf.get_u8();
13588 __struct.gimbal_device_id = buf.get_u8();
13589 Ok(__struct)
13590 }
13591 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13592 let mut __tmp = BytesMut::new(bytes);
13593 #[allow(clippy::absurd_extreme_comparisons)]
13594 #[allow(unused_comparisons)]
13595 if __tmp.remaining() < Self::ENCODED_LEN {
13596 panic!(
13597 "buffer is too small (need {} bytes, but got {})",
13598 Self::ENCODED_LEN,
13599 __tmp.remaining(),
13600 )
13601 }
13602 __tmp.put_u32_le(self.flags.bits());
13603 __tmp.put_f32_le(self.pitch);
13604 __tmp.put_f32_le(self.yaw);
13605 __tmp.put_f32_le(self.pitch_rate);
13606 __tmp.put_f32_le(self.yaw_rate);
13607 __tmp.put_u8(self.target_system);
13608 __tmp.put_u8(self.target_component);
13609 __tmp.put_u8(self.gimbal_device_id);
13610 if matches!(version, MavlinkVersion::V2) {
13611 let len = __tmp.len();
13612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13613 } else {
13614 __tmp.len()
13615 }
13616 }
13617}
13618#[doc = "id: 287"]
13619#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13620#[derive(Debug, Clone, PartialEq)]
13621#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13623pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13624 #[doc = "High level gimbal manager flags to use."]
13625 pub flags: GimbalManagerFlags,
13626 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13627 pub pitch: f32,
13628 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13629 pub yaw: f32,
13630 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13631 pub pitch_rate: f32,
13632 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13633 pub yaw_rate: f32,
13634 #[doc = "System ID"]
13635 pub target_system: u8,
13636 #[doc = "Component ID"]
13637 pub target_component: u8,
13638 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13639 pub gimbal_device_id: u8,
13640}
13641impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13642 pub const ENCODED_LEN: usize = 23usize;
13643 pub const DEFAULT: Self = Self {
13644 flags: GimbalManagerFlags::DEFAULT,
13645 pitch: 0.0_f32,
13646 yaw: 0.0_f32,
13647 pitch_rate: 0.0_f32,
13648 yaw_rate: 0.0_f32,
13649 target_system: 0_u8,
13650 target_component: 0_u8,
13651 gimbal_device_id: 0_u8,
13652 };
13653 #[cfg(feature = "arbitrary")]
13654 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13655 use arbitrary::{Arbitrary, Unstructured};
13656 let mut buf = [0u8; 1024];
13657 rng.fill_bytes(&mut buf);
13658 let mut unstructured = Unstructured::new(&buf);
13659 Self::arbitrary(&mut unstructured).unwrap_or_default()
13660 }
13661}
13662impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13663 fn default() -> Self {
13664 Self::DEFAULT.clone()
13665 }
13666}
13667impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13668 type Message = MavMessage;
13669 const ID: u32 = 287u32;
13670 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13671 const EXTRA_CRC: u8 = 1u8;
13672 const ENCODED_LEN: usize = 23usize;
13673 fn deser(
13674 _version: MavlinkVersion,
13675 __input: &[u8],
13676 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13677 let avail_len = __input.len();
13678 let mut payload_buf = [0; Self::ENCODED_LEN];
13679 let mut buf = if avail_len < Self::ENCODED_LEN {
13680 payload_buf[0..avail_len].copy_from_slice(__input);
13681 Bytes::new(&payload_buf)
13682 } else {
13683 Bytes::new(__input)
13684 };
13685 let mut __struct = Self::default();
13686 let tmp = buf.get_u32_le();
13687 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13688 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13689 flag_type: "GimbalManagerFlags",
13690 value: tmp as u32,
13691 })?;
13692 __struct.pitch = buf.get_f32_le();
13693 __struct.yaw = buf.get_f32_le();
13694 __struct.pitch_rate = buf.get_f32_le();
13695 __struct.yaw_rate = buf.get_f32_le();
13696 __struct.target_system = buf.get_u8();
13697 __struct.target_component = buf.get_u8();
13698 __struct.gimbal_device_id = buf.get_u8();
13699 Ok(__struct)
13700 }
13701 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13702 let mut __tmp = BytesMut::new(bytes);
13703 #[allow(clippy::absurd_extreme_comparisons)]
13704 #[allow(unused_comparisons)]
13705 if __tmp.remaining() < Self::ENCODED_LEN {
13706 panic!(
13707 "buffer is too small (need {} bytes, but got {})",
13708 Self::ENCODED_LEN,
13709 __tmp.remaining(),
13710 )
13711 }
13712 __tmp.put_u32_le(self.flags.bits());
13713 __tmp.put_f32_le(self.pitch);
13714 __tmp.put_f32_le(self.yaw);
13715 __tmp.put_f32_le(self.pitch_rate);
13716 __tmp.put_f32_le(self.yaw_rate);
13717 __tmp.put_u8(self.target_system);
13718 __tmp.put_u8(self.target_component);
13719 __tmp.put_u8(self.gimbal_device_id);
13720 if matches!(version, MavlinkVersion::V2) {
13721 let len = __tmp.len();
13722 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13723 } else {
13724 __tmp.len()
13725 }
13726 }
13727}
13728#[doc = "id: 281"]
13729#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13730#[derive(Debug, Clone, PartialEq)]
13731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13733pub struct GIMBAL_MANAGER_STATUS_DATA {
13734 #[doc = "Timestamp (time since system boot)."]
13735 pub time_boot_ms: u32,
13736 #[doc = "High level gimbal manager flags currently applied."]
13737 pub flags: GimbalManagerFlags,
13738 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13739 pub gimbal_device_id: u8,
13740 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13741 pub primary_control_sysid: u8,
13742 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13743 pub primary_control_compid: u8,
13744 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13745 pub secondary_control_sysid: u8,
13746 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13747 pub secondary_control_compid: u8,
13748}
13749impl GIMBAL_MANAGER_STATUS_DATA {
13750 pub const ENCODED_LEN: usize = 13usize;
13751 pub const DEFAULT: Self = Self {
13752 time_boot_ms: 0_u32,
13753 flags: GimbalManagerFlags::DEFAULT,
13754 gimbal_device_id: 0_u8,
13755 primary_control_sysid: 0_u8,
13756 primary_control_compid: 0_u8,
13757 secondary_control_sysid: 0_u8,
13758 secondary_control_compid: 0_u8,
13759 };
13760 #[cfg(feature = "arbitrary")]
13761 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13762 use arbitrary::{Arbitrary, Unstructured};
13763 let mut buf = [0u8; 1024];
13764 rng.fill_bytes(&mut buf);
13765 let mut unstructured = Unstructured::new(&buf);
13766 Self::arbitrary(&mut unstructured).unwrap_or_default()
13767 }
13768}
13769impl Default for GIMBAL_MANAGER_STATUS_DATA {
13770 fn default() -> Self {
13771 Self::DEFAULT.clone()
13772 }
13773}
13774impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13775 type Message = MavMessage;
13776 const ID: u32 = 281u32;
13777 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13778 const EXTRA_CRC: u8 = 48u8;
13779 const ENCODED_LEN: usize = 13usize;
13780 fn deser(
13781 _version: MavlinkVersion,
13782 __input: &[u8],
13783 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13784 let avail_len = __input.len();
13785 let mut payload_buf = [0; Self::ENCODED_LEN];
13786 let mut buf = if avail_len < Self::ENCODED_LEN {
13787 payload_buf[0..avail_len].copy_from_slice(__input);
13788 Bytes::new(&payload_buf)
13789 } else {
13790 Bytes::new(__input)
13791 };
13792 let mut __struct = Self::default();
13793 __struct.time_boot_ms = buf.get_u32_le();
13794 let tmp = buf.get_u32_le();
13795 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13796 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13797 flag_type: "GimbalManagerFlags",
13798 value: tmp as u32,
13799 })?;
13800 __struct.gimbal_device_id = buf.get_u8();
13801 __struct.primary_control_sysid = buf.get_u8();
13802 __struct.primary_control_compid = buf.get_u8();
13803 __struct.secondary_control_sysid = buf.get_u8();
13804 __struct.secondary_control_compid = buf.get_u8();
13805 Ok(__struct)
13806 }
13807 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13808 let mut __tmp = BytesMut::new(bytes);
13809 #[allow(clippy::absurd_extreme_comparisons)]
13810 #[allow(unused_comparisons)]
13811 if __tmp.remaining() < Self::ENCODED_LEN {
13812 panic!(
13813 "buffer is too small (need {} bytes, but got {})",
13814 Self::ENCODED_LEN,
13815 __tmp.remaining(),
13816 )
13817 }
13818 __tmp.put_u32_le(self.time_boot_ms);
13819 __tmp.put_u32_le(self.flags.bits());
13820 __tmp.put_u8(self.gimbal_device_id);
13821 __tmp.put_u8(self.primary_control_sysid);
13822 __tmp.put_u8(self.primary_control_compid);
13823 __tmp.put_u8(self.secondary_control_sysid);
13824 __tmp.put_u8(self.secondary_control_compid);
13825 if matches!(version, MavlinkVersion::V2) {
13826 let len = __tmp.len();
13827 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13828 } else {
13829 __tmp.len()
13830 }
13831 }
13832}
13833#[doc = "id: 33"]
13834#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13835#[derive(Debug, Clone, PartialEq)]
13836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13837#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13838pub struct GLOBAL_POSITION_INT_DATA {
13839 #[doc = "Timestamp (time since system boot)."]
13840 pub time_boot_ms: u32,
13841 #[doc = "Latitude, expressed"]
13842 pub lat: i32,
13843 #[doc = "Longitude, expressed"]
13844 pub lon: i32,
13845 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13846 pub alt: i32,
13847 #[doc = "Altitude above home"]
13848 pub relative_alt: i32,
13849 #[doc = "Ground X Speed (Latitude, positive north)"]
13850 pub vx: i16,
13851 #[doc = "Ground Y Speed (Longitude, positive east)"]
13852 pub vy: i16,
13853 #[doc = "Ground Z Speed (Altitude, positive down)"]
13854 pub vz: i16,
13855 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13856 pub hdg: u16,
13857}
13858impl GLOBAL_POSITION_INT_DATA {
13859 pub const ENCODED_LEN: usize = 28usize;
13860 pub const DEFAULT: Self = Self {
13861 time_boot_ms: 0_u32,
13862 lat: 0_i32,
13863 lon: 0_i32,
13864 alt: 0_i32,
13865 relative_alt: 0_i32,
13866 vx: 0_i16,
13867 vy: 0_i16,
13868 vz: 0_i16,
13869 hdg: 0_u16,
13870 };
13871 #[cfg(feature = "arbitrary")]
13872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13873 use arbitrary::{Arbitrary, Unstructured};
13874 let mut buf = [0u8; 1024];
13875 rng.fill_bytes(&mut buf);
13876 let mut unstructured = Unstructured::new(&buf);
13877 Self::arbitrary(&mut unstructured).unwrap_or_default()
13878 }
13879}
13880impl Default for GLOBAL_POSITION_INT_DATA {
13881 fn default() -> Self {
13882 Self::DEFAULT.clone()
13883 }
13884}
13885impl MessageData for GLOBAL_POSITION_INT_DATA {
13886 type Message = MavMessage;
13887 const ID: u32 = 33u32;
13888 const NAME: &'static str = "GLOBAL_POSITION_INT";
13889 const EXTRA_CRC: u8 = 104u8;
13890 const ENCODED_LEN: usize = 28usize;
13891 fn deser(
13892 _version: MavlinkVersion,
13893 __input: &[u8],
13894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13895 let avail_len = __input.len();
13896 let mut payload_buf = [0; Self::ENCODED_LEN];
13897 let mut buf = if avail_len < Self::ENCODED_LEN {
13898 payload_buf[0..avail_len].copy_from_slice(__input);
13899 Bytes::new(&payload_buf)
13900 } else {
13901 Bytes::new(__input)
13902 };
13903 let mut __struct = Self::default();
13904 __struct.time_boot_ms = buf.get_u32_le();
13905 __struct.lat = buf.get_i32_le();
13906 __struct.lon = buf.get_i32_le();
13907 __struct.alt = buf.get_i32_le();
13908 __struct.relative_alt = buf.get_i32_le();
13909 __struct.vx = buf.get_i16_le();
13910 __struct.vy = buf.get_i16_le();
13911 __struct.vz = buf.get_i16_le();
13912 __struct.hdg = buf.get_u16_le();
13913 Ok(__struct)
13914 }
13915 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13916 let mut __tmp = BytesMut::new(bytes);
13917 #[allow(clippy::absurd_extreme_comparisons)]
13918 #[allow(unused_comparisons)]
13919 if __tmp.remaining() < Self::ENCODED_LEN {
13920 panic!(
13921 "buffer is too small (need {} bytes, but got {})",
13922 Self::ENCODED_LEN,
13923 __tmp.remaining(),
13924 )
13925 }
13926 __tmp.put_u32_le(self.time_boot_ms);
13927 __tmp.put_i32_le(self.lat);
13928 __tmp.put_i32_le(self.lon);
13929 __tmp.put_i32_le(self.alt);
13930 __tmp.put_i32_le(self.relative_alt);
13931 __tmp.put_i16_le(self.vx);
13932 __tmp.put_i16_le(self.vy);
13933 __tmp.put_i16_le(self.vz);
13934 __tmp.put_u16_le(self.hdg);
13935 if matches!(version, MavlinkVersion::V2) {
13936 let len = __tmp.len();
13937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13938 } else {
13939 __tmp.len()
13940 }
13941 }
13942}
13943#[doc = "id: 63"]
13944#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13945#[derive(Debug, Clone, PartialEq)]
13946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13948pub struct GLOBAL_POSITION_INT_COV_DATA {
13949 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13950 pub time_usec: u64,
13951 #[doc = "Latitude"]
13952 pub lat: i32,
13953 #[doc = "Longitude"]
13954 pub lon: i32,
13955 #[doc = "Altitude in meters above MSL"]
13956 pub alt: i32,
13957 #[doc = "Altitude above ground"]
13958 pub relative_alt: i32,
13959 #[doc = "Ground X Speed (Latitude)"]
13960 pub vx: f32,
13961 #[doc = "Ground Y Speed (Longitude)"]
13962 pub vy: f32,
13963 #[doc = "Ground Z Speed (Altitude)"]
13964 pub vz: f32,
13965 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13966 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13967 pub covariance: [f32; 36],
13968 #[doc = "Class id of the estimator this estimate originated from."]
13969 pub estimator_type: MavEstimatorType,
13970}
13971impl GLOBAL_POSITION_INT_COV_DATA {
13972 pub const ENCODED_LEN: usize = 181usize;
13973 pub const DEFAULT: Self = Self {
13974 time_usec: 0_u64,
13975 lat: 0_i32,
13976 lon: 0_i32,
13977 alt: 0_i32,
13978 relative_alt: 0_i32,
13979 vx: 0.0_f32,
13980 vy: 0.0_f32,
13981 vz: 0.0_f32,
13982 covariance: [0.0_f32; 36usize],
13983 estimator_type: MavEstimatorType::DEFAULT,
13984 };
13985 #[cfg(feature = "arbitrary")]
13986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13987 use arbitrary::{Arbitrary, Unstructured};
13988 let mut buf = [0u8; 1024];
13989 rng.fill_bytes(&mut buf);
13990 let mut unstructured = Unstructured::new(&buf);
13991 Self::arbitrary(&mut unstructured).unwrap_or_default()
13992 }
13993}
13994impl Default for GLOBAL_POSITION_INT_COV_DATA {
13995 fn default() -> Self {
13996 Self::DEFAULT.clone()
13997 }
13998}
13999impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
14000 type Message = MavMessage;
14001 const ID: u32 = 63u32;
14002 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
14003 const EXTRA_CRC: u8 = 119u8;
14004 const ENCODED_LEN: usize = 181usize;
14005 fn deser(
14006 _version: MavlinkVersion,
14007 __input: &[u8],
14008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14009 let avail_len = __input.len();
14010 let mut payload_buf = [0; Self::ENCODED_LEN];
14011 let mut buf = if avail_len < Self::ENCODED_LEN {
14012 payload_buf[0..avail_len].copy_from_slice(__input);
14013 Bytes::new(&payload_buf)
14014 } else {
14015 Bytes::new(__input)
14016 };
14017 let mut __struct = Self::default();
14018 __struct.time_usec = buf.get_u64_le();
14019 __struct.lat = buf.get_i32_le();
14020 __struct.lon = buf.get_i32_le();
14021 __struct.alt = buf.get_i32_le();
14022 __struct.relative_alt = buf.get_i32_le();
14023 __struct.vx = buf.get_f32_le();
14024 __struct.vy = buf.get_f32_le();
14025 __struct.vz = buf.get_f32_le();
14026 for v in &mut __struct.covariance {
14027 let val = buf.get_f32_le();
14028 *v = val;
14029 }
14030 let tmp = buf.get_u8();
14031 __struct.estimator_type =
14032 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14033 enum_type: "MavEstimatorType",
14034 value: tmp as u32,
14035 })?;
14036 Ok(__struct)
14037 }
14038 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14039 let mut __tmp = BytesMut::new(bytes);
14040 #[allow(clippy::absurd_extreme_comparisons)]
14041 #[allow(unused_comparisons)]
14042 if __tmp.remaining() < Self::ENCODED_LEN {
14043 panic!(
14044 "buffer is too small (need {} bytes, but got {})",
14045 Self::ENCODED_LEN,
14046 __tmp.remaining(),
14047 )
14048 }
14049 __tmp.put_u64_le(self.time_usec);
14050 __tmp.put_i32_le(self.lat);
14051 __tmp.put_i32_le(self.lon);
14052 __tmp.put_i32_le(self.alt);
14053 __tmp.put_i32_le(self.relative_alt);
14054 __tmp.put_f32_le(self.vx);
14055 __tmp.put_f32_le(self.vy);
14056 __tmp.put_f32_le(self.vz);
14057 for val in &self.covariance {
14058 __tmp.put_f32_le(*val);
14059 }
14060 __tmp.put_u8(self.estimator_type as u8);
14061 if matches!(version, MavlinkVersion::V2) {
14062 let len = __tmp.len();
14063 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14064 } else {
14065 __tmp.len()
14066 }
14067 }
14068}
14069#[doc = "id: 101"]
14070#[doc = "Global position/attitude estimate from a vision source."]
14071#[derive(Debug, Clone, PartialEq)]
14072#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14073#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14074pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14075 #[doc = "Timestamp (UNIX time or since system boot)"]
14076 pub usec: u64,
14077 #[doc = "Global X position"]
14078 pub x: f32,
14079 #[doc = "Global Y position"]
14080 pub y: f32,
14081 #[doc = "Global Z position"]
14082 pub z: f32,
14083 #[doc = "Roll angle"]
14084 pub roll: f32,
14085 #[doc = "Pitch angle"]
14086 pub pitch: f32,
14087 #[doc = "Yaw angle"]
14088 pub yaw: f32,
14089 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
14090 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14091 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14092 pub covariance: [f32; 21],
14093 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
14094 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14095 pub reset_counter: u8,
14096}
14097impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14098 pub const ENCODED_LEN: usize = 117usize;
14099 pub const DEFAULT: Self = Self {
14100 usec: 0_u64,
14101 x: 0.0_f32,
14102 y: 0.0_f32,
14103 z: 0.0_f32,
14104 roll: 0.0_f32,
14105 pitch: 0.0_f32,
14106 yaw: 0.0_f32,
14107 covariance: [0.0_f32; 21usize],
14108 reset_counter: 0_u8,
14109 };
14110 #[cfg(feature = "arbitrary")]
14111 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14112 use arbitrary::{Arbitrary, Unstructured};
14113 let mut buf = [0u8; 1024];
14114 rng.fill_bytes(&mut buf);
14115 let mut unstructured = Unstructured::new(&buf);
14116 Self::arbitrary(&mut unstructured).unwrap_or_default()
14117 }
14118}
14119impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14120 fn default() -> Self {
14121 Self::DEFAULT.clone()
14122 }
14123}
14124impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14125 type Message = MavMessage;
14126 const ID: u32 = 101u32;
14127 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
14128 const EXTRA_CRC: u8 = 102u8;
14129 const ENCODED_LEN: usize = 117usize;
14130 fn deser(
14131 _version: MavlinkVersion,
14132 __input: &[u8],
14133 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14134 let avail_len = __input.len();
14135 let mut payload_buf = [0; Self::ENCODED_LEN];
14136 let mut buf = if avail_len < Self::ENCODED_LEN {
14137 payload_buf[0..avail_len].copy_from_slice(__input);
14138 Bytes::new(&payload_buf)
14139 } else {
14140 Bytes::new(__input)
14141 };
14142 let mut __struct = Self::default();
14143 __struct.usec = buf.get_u64_le();
14144 __struct.x = buf.get_f32_le();
14145 __struct.y = buf.get_f32_le();
14146 __struct.z = buf.get_f32_le();
14147 __struct.roll = buf.get_f32_le();
14148 __struct.pitch = buf.get_f32_le();
14149 __struct.yaw = buf.get_f32_le();
14150 for v in &mut __struct.covariance {
14151 let val = buf.get_f32_le();
14152 *v = val;
14153 }
14154 __struct.reset_counter = buf.get_u8();
14155 Ok(__struct)
14156 }
14157 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14158 let mut __tmp = BytesMut::new(bytes);
14159 #[allow(clippy::absurd_extreme_comparisons)]
14160 #[allow(unused_comparisons)]
14161 if __tmp.remaining() < Self::ENCODED_LEN {
14162 panic!(
14163 "buffer is too small (need {} bytes, but got {})",
14164 Self::ENCODED_LEN,
14165 __tmp.remaining(),
14166 )
14167 }
14168 __tmp.put_u64_le(self.usec);
14169 __tmp.put_f32_le(self.x);
14170 __tmp.put_f32_le(self.y);
14171 __tmp.put_f32_le(self.z);
14172 __tmp.put_f32_le(self.roll);
14173 __tmp.put_f32_le(self.pitch);
14174 __tmp.put_f32_le(self.yaw);
14175 for val in &self.covariance {
14176 __tmp.put_f32_le(*val);
14177 }
14178 __tmp.put_u8(self.reset_counter);
14179 if matches!(version, MavlinkVersion::V2) {
14180 let len = __tmp.len();
14181 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14182 } else {
14183 __tmp.len()
14184 }
14185 }
14186}
14187#[doc = "id: 124"]
14188#[doc = "Second GPS data."]
14189#[derive(Debug, Clone, PartialEq)]
14190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14192pub struct GPS2_RAW_DATA {
14193 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14194 pub time_usec: u64,
14195 #[doc = "Latitude (WGS84)"]
14196 pub lat: i32,
14197 #[doc = "Longitude (WGS84)"]
14198 pub lon: i32,
14199 #[doc = "Altitude (MSL). Positive for up."]
14200 pub alt: i32,
14201 #[doc = "Age of DGPS info"]
14202 pub dgps_age: u32,
14203 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14204 pub eph: u16,
14205 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14206 pub epv: u16,
14207 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14208 pub vel: u16,
14209 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14210 pub cog: u16,
14211 #[doc = "GPS fix type."]
14212 pub fix_type: GpsFixType,
14213 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14214 pub satellites_visible: u8,
14215 #[doc = "Number of DGPS satellites"]
14216 pub dgps_numch: u8,
14217 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14218 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14219 pub yaw: u16,
14220 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14221 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14222 pub alt_ellipsoid: i32,
14223 #[doc = "Position uncertainty."]
14224 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14225 pub h_acc: u32,
14226 #[doc = "Altitude uncertainty."]
14227 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14228 pub v_acc: u32,
14229 #[doc = "Speed uncertainty."]
14230 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14231 pub vel_acc: u32,
14232 #[doc = "Heading / track uncertainty"]
14233 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14234 pub hdg_acc: u32,
14235}
14236impl GPS2_RAW_DATA {
14237 pub const ENCODED_LEN: usize = 57usize;
14238 pub const DEFAULT: Self = Self {
14239 time_usec: 0_u64,
14240 lat: 0_i32,
14241 lon: 0_i32,
14242 alt: 0_i32,
14243 dgps_age: 0_u32,
14244 eph: 0_u16,
14245 epv: 0_u16,
14246 vel: 0_u16,
14247 cog: 0_u16,
14248 fix_type: GpsFixType::DEFAULT,
14249 satellites_visible: 0_u8,
14250 dgps_numch: 0_u8,
14251 yaw: 0_u16,
14252 alt_ellipsoid: 0_i32,
14253 h_acc: 0_u32,
14254 v_acc: 0_u32,
14255 vel_acc: 0_u32,
14256 hdg_acc: 0_u32,
14257 };
14258 #[cfg(feature = "arbitrary")]
14259 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14260 use arbitrary::{Arbitrary, Unstructured};
14261 let mut buf = [0u8; 1024];
14262 rng.fill_bytes(&mut buf);
14263 let mut unstructured = Unstructured::new(&buf);
14264 Self::arbitrary(&mut unstructured).unwrap_or_default()
14265 }
14266}
14267impl Default for GPS2_RAW_DATA {
14268 fn default() -> Self {
14269 Self::DEFAULT.clone()
14270 }
14271}
14272impl MessageData for GPS2_RAW_DATA {
14273 type Message = MavMessage;
14274 const ID: u32 = 124u32;
14275 const NAME: &'static str = "GPS2_RAW";
14276 const EXTRA_CRC: u8 = 87u8;
14277 const ENCODED_LEN: usize = 57usize;
14278 fn deser(
14279 _version: MavlinkVersion,
14280 __input: &[u8],
14281 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14282 let avail_len = __input.len();
14283 let mut payload_buf = [0; Self::ENCODED_LEN];
14284 let mut buf = if avail_len < Self::ENCODED_LEN {
14285 payload_buf[0..avail_len].copy_from_slice(__input);
14286 Bytes::new(&payload_buf)
14287 } else {
14288 Bytes::new(__input)
14289 };
14290 let mut __struct = Self::default();
14291 __struct.time_usec = buf.get_u64_le();
14292 __struct.lat = buf.get_i32_le();
14293 __struct.lon = buf.get_i32_le();
14294 __struct.alt = buf.get_i32_le();
14295 __struct.dgps_age = buf.get_u32_le();
14296 __struct.eph = buf.get_u16_le();
14297 __struct.epv = buf.get_u16_le();
14298 __struct.vel = buf.get_u16_le();
14299 __struct.cog = buf.get_u16_le();
14300 let tmp = buf.get_u8();
14301 __struct.fix_type =
14302 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14303 enum_type: "GpsFixType",
14304 value: tmp as u32,
14305 })?;
14306 __struct.satellites_visible = buf.get_u8();
14307 __struct.dgps_numch = buf.get_u8();
14308 __struct.yaw = buf.get_u16_le();
14309 __struct.alt_ellipsoid = buf.get_i32_le();
14310 __struct.h_acc = buf.get_u32_le();
14311 __struct.v_acc = buf.get_u32_le();
14312 __struct.vel_acc = buf.get_u32_le();
14313 __struct.hdg_acc = buf.get_u32_le();
14314 Ok(__struct)
14315 }
14316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14317 let mut __tmp = BytesMut::new(bytes);
14318 #[allow(clippy::absurd_extreme_comparisons)]
14319 #[allow(unused_comparisons)]
14320 if __tmp.remaining() < Self::ENCODED_LEN {
14321 panic!(
14322 "buffer is too small (need {} bytes, but got {})",
14323 Self::ENCODED_LEN,
14324 __tmp.remaining(),
14325 )
14326 }
14327 __tmp.put_u64_le(self.time_usec);
14328 __tmp.put_i32_le(self.lat);
14329 __tmp.put_i32_le(self.lon);
14330 __tmp.put_i32_le(self.alt);
14331 __tmp.put_u32_le(self.dgps_age);
14332 __tmp.put_u16_le(self.eph);
14333 __tmp.put_u16_le(self.epv);
14334 __tmp.put_u16_le(self.vel);
14335 __tmp.put_u16_le(self.cog);
14336 __tmp.put_u8(self.fix_type as u8);
14337 __tmp.put_u8(self.satellites_visible);
14338 __tmp.put_u8(self.dgps_numch);
14339 __tmp.put_u16_le(self.yaw);
14340 __tmp.put_i32_le(self.alt_ellipsoid);
14341 __tmp.put_u32_le(self.h_acc);
14342 __tmp.put_u32_le(self.v_acc);
14343 __tmp.put_u32_le(self.vel_acc);
14344 __tmp.put_u32_le(self.hdg_acc);
14345 if matches!(version, MavlinkVersion::V2) {
14346 let len = __tmp.len();
14347 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14348 } else {
14349 __tmp.len()
14350 }
14351 }
14352}
14353#[doc = "id: 128"]
14354#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14355#[derive(Debug, Clone, PartialEq)]
14356#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14357#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14358pub struct GPS2_RTK_DATA {
14359 #[doc = "Time since boot of last baseline message received."]
14360 pub time_last_baseline_ms: u32,
14361 #[doc = "GPS Time of Week of last baseline"]
14362 pub tow: u32,
14363 #[doc = "Current baseline in ECEF x or NED north component."]
14364 pub baseline_a_mm: i32,
14365 #[doc = "Current baseline in ECEF y or NED east component."]
14366 pub baseline_b_mm: i32,
14367 #[doc = "Current baseline in ECEF z or NED down component."]
14368 pub baseline_c_mm: i32,
14369 #[doc = "Current estimate of baseline accuracy."]
14370 pub accuracy: u32,
14371 #[doc = "Current number of integer ambiguity hypotheses."]
14372 pub iar_num_hypotheses: i32,
14373 #[doc = "GPS Week Number of last baseline"]
14374 pub wn: u16,
14375 #[doc = "Identification of connected RTK receiver."]
14376 pub rtk_receiver_id: u8,
14377 #[doc = "GPS-specific health report for RTK data."]
14378 pub rtk_health: u8,
14379 #[doc = "Rate of baseline messages being received by GPS"]
14380 pub rtk_rate: u8,
14381 #[doc = "Current number of sats used for RTK calculation."]
14382 pub nsats: u8,
14383 #[doc = "Coordinate system of baseline"]
14384 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14385}
14386impl GPS2_RTK_DATA {
14387 pub const ENCODED_LEN: usize = 35usize;
14388 pub const DEFAULT: Self = Self {
14389 time_last_baseline_ms: 0_u32,
14390 tow: 0_u32,
14391 baseline_a_mm: 0_i32,
14392 baseline_b_mm: 0_i32,
14393 baseline_c_mm: 0_i32,
14394 accuracy: 0_u32,
14395 iar_num_hypotheses: 0_i32,
14396 wn: 0_u16,
14397 rtk_receiver_id: 0_u8,
14398 rtk_health: 0_u8,
14399 rtk_rate: 0_u8,
14400 nsats: 0_u8,
14401 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14402 };
14403 #[cfg(feature = "arbitrary")]
14404 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14405 use arbitrary::{Arbitrary, Unstructured};
14406 let mut buf = [0u8; 1024];
14407 rng.fill_bytes(&mut buf);
14408 let mut unstructured = Unstructured::new(&buf);
14409 Self::arbitrary(&mut unstructured).unwrap_or_default()
14410 }
14411}
14412impl Default for GPS2_RTK_DATA {
14413 fn default() -> Self {
14414 Self::DEFAULT.clone()
14415 }
14416}
14417impl MessageData for GPS2_RTK_DATA {
14418 type Message = MavMessage;
14419 const ID: u32 = 128u32;
14420 const NAME: &'static str = "GPS2_RTK";
14421 const EXTRA_CRC: u8 = 226u8;
14422 const ENCODED_LEN: usize = 35usize;
14423 fn deser(
14424 _version: MavlinkVersion,
14425 __input: &[u8],
14426 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14427 let avail_len = __input.len();
14428 let mut payload_buf = [0; Self::ENCODED_LEN];
14429 let mut buf = if avail_len < Self::ENCODED_LEN {
14430 payload_buf[0..avail_len].copy_from_slice(__input);
14431 Bytes::new(&payload_buf)
14432 } else {
14433 Bytes::new(__input)
14434 };
14435 let mut __struct = Self::default();
14436 __struct.time_last_baseline_ms = buf.get_u32_le();
14437 __struct.tow = buf.get_u32_le();
14438 __struct.baseline_a_mm = buf.get_i32_le();
14439 __struct.baseline_b_mm = buf.get_i32_le();
14440 __struct.baseline_c_mm = buf.get_i32_le();
14441 __struct.accuracy = buf.get_u32_le();
14442 __struct.iar_num_hypotheses = buf.get_i32_le();
14443 __struct.wn = buf.get_u16_le();
14444 __struct.rtk_receiver_id = buf.get_u8();
14445 __struct.rtk_health = buf.get_u8();
14446 __struct.rtk_rate = buf.get_u8();
14447 __struct.nsats = buf.get_u8();
14448 let tmp = buf.get_u8();
14449 __struct.baseline_coords_type =
14450 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14451 enum_type: "RtkBaselineCoordinateSystem",
14452 value: tmp as u32,
14453 })?;
14454 Ok(__struct)
14455 }
14456 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14457 let mut __tmp = BytesMut::new(bytes);
14458 #[allow(clippy::absurd_extreme_comparisons)]
14459 #[allow(unused_comparisons)]
14460 if __tmp.remaining() < Self::ENCODED_LEN {
14461 panic!(
14462 "buffer is too small (need {} bytes, but got {})",
14463 Self::ENCODED_LEN,
14464 __tmp.remaining(),
14465 )
14466 }
14467 __tmp.put_u32_le(self.time_last_baseline_ms);
14468 __tmp.put_u32_le(self.tow);
14469 __tmp.put_i32_le(self.baseline_a_mm);
14470 __tmp.put_i32_le(self.baseline_b_mm);
14471 __tmp.put_i32_le(self.baseline_c_mm);
14472 __tmp.put_u32_le(self.accuracy);
14473 __tmp.put_i32_le(self.iar_num_hypotheses);
14474 __tmp.put_u16_le(self.wn);
14475 __tmp.put_u8(self.rtk_receiver_id);
14476 __tmp.put_u8(self.rtk_health);
14477 __tmp.put_u8(self.rtk_rate);
14478 __tmp.put_u8(self.nsats);
14479 __tmp.put_u8(self.baseline_coords_type as u8);
14480 if matches!(version, MavlinkVersion::V2) {
14481 let len = __tmp.len();
14482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14483 } else {
14484 __tmp.len()
14485 }
14486 }
14487}
14488#[doc = "id: 49"]
14489#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14490#[derive(Debug, Clone, PartialEq)]
14491#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14493pub struct GPS_GLOBAL_ORIGIN_DATA {
14494 #[doc = "Latitude (WGS84)"]
14495 pub latitude: i32,
14496 #[doc = "Longitude (WGS84)"]
14497 pub longitude: i32,
14498 #[doc = "Altitude (MSL). Positive for up."]
14499 pub altitude: i32,
14500 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14501 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14502 pub time_usec: u64,
14503}
14504impl GPS_GLOBAL_ORIGIN_DATA {
14505 pub const ENCODED_LEN: usize = 20usize;
14506 pub const DEFAULT: Self = Self {
14507 latitude: 0_i32,
14508 longitude: 0_i32,
14509 altitude: 0_i32,
14510 time_usec: 0_u64,
14511 };
14512 #[cfg(feature = "arbitrary")]
14513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14514 use arbitrary::{Arbitrary, Unstructured};
14515 let mut buf = [0u8; 1024];
14516 rng.fill_bytes(&mut buf);
14517 let mut unstructured = Unstructured::new(&buf);
14518 Self::arbitrary(&mut unstructured).unwrap_or_default()
14519 }
14520}
14521impl Default for GPS_GLOBAL_ORIGIN_DATA {
14522 fn default() -> Self {
14523 Self::DEFAULT.clone()
14524 }
14525}
14526impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14527 type Message = MavMessage;
14528 const ID: u32 = 49u32;
14529 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14530 const EXTRA_CRC: u8 = 39u8;
14531 const ENCODED_LEN: usize = 20usize;
14532 fn deser(
14533 _version: MavlinkVersion,
14534 __input: &[u8],
14535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14536 let avail_len = __input.len();
14537 let mut payload_buf = [0; Self::ENCODED_LEN];
14538 let mut buf = if avail_len < Self::ENCODED_LEN {
14539 payload_buf[0..avail_len].copy_from_slice(__input);
14540 Bytes::new(&payload_buf)
14541 } else {
14542 Bytes::new(__input)
14543 };
14544 let mut __struct = Self::default();
14545 __struct.latitude = buf.get_i32_le();
14546 __struct.longitude = buf.get_i32_le();
14547 __struct.altitude = buf.get_i32_le();
14548 __struct.time_usec = buf.get_u64_le();
14549 Ok(__struct)
14550 }
14551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14552 let mut __tmp = BytesMut::new(bytes);
14553 #[allow(clippy::absurd_extreme_comparisons)]
14554 #[allow(unused_comparisons)]
14555 if __tmp.remaining() < Self::ENCODED_LEN {
14556 panic!(
14557 "buffer is too small (need {} bytes, but got {})",
14558 Self::ENCODED_LEN,
14559 __tmp.remaining(),
14560 )
14561 }
14562 __tmp.put_i32_le(self.latitude);
14563 __tmp.put_i32_le(self.longitude);
14564 __tmp.put_i32_le(self.altitude);
14565 __tmp.put_u64_le(self.time_usec);
14566 if matches!(version, MavlinkVersion::V2) {
14567 let len = __tmp.len();
14568 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14569 } else {
14570 __tmp.len()
14571 }
14572 }
14573}
14574#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14575#[doc = "id: 123"]
14576#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14577#[derive(Debug, Clone, PartialEq)]
14578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14580pub struct GPS_INJECT_DATA_DATA {
14581 #[doc = "System ID"]
14582 pub target_system: u8,
14583 #[doc = "Component ID"]
14584 pub target_component: u8,
14585 #[doc = "Data length"]
14586 pub len: u8,
14587 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14588 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14589 pub data: [u8; 110],
14590}
14591impl GPS_INJECT_DATA_DATA {
14592 pub const ENCODED_LEN: usize = 113usize;
14593 pub const DEFAULT: Self = Self {
14594 target_system: 0_u8,
14595 target_component: 0_u8,
14596 len: 0_u8,
14597 data: [0_u8; 110usize],
14598 };
14599 #[cfg(feature = "arbitrary")]
14600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14601 use arbitrary::{Arbitrary, Unstructured};
14602 let mut buf = [0u8; 1024];
14603 rng.fill_bytes(&mut buf);
14604 let mut unstructured = Unstructured::new(&buf);
14605 Self::arbitrary(&mut unstructured).unwrap_or_default()
14606 }
14607}
14608impl Default for GPS_INJECT_DATA_DATA {
14609 fn default() -> Self {
14610 Self::DEFAULT.clone()
14611 }
14612}
14613impl MessageData for GPS_INJECT_DATA_DATA {
14614 type Message = MavMessage;
14615 const ID: u32 = 123u32;
14616 const NAME: &'static str = "GPS_INJECT_DATA";
14617 const EXTRA_CRC: u8 = 250u8;
14618 const ENCODED_LEN: usize = 113usize;
14619 fn deser(
14620 _version: MavlinkVersion,
14621 __input: &[u8],
14622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14623 let avail_len = __input.len();
14624 let mut payload_buf = [0; Self::ENCODED_LEN];
14625 let mut buf = if avail_len < Self::ENCODED_LEN {
14626 payload_buf[0..avail_len].copy_from_slice(__input);
14627 Bytes::new(&payload_buf)
14628 } else {
14629 Bytes::new(__input)
14630 };
14631 let mut __struct = Self::default();
14632 __struct.target_system = buf.get_u8();
14633 __struct.target_component = buf.get_u8();
14634 __struct.len = buf.get_u8();
14635 for v in &mut __struct.data {
14636 let val = buf.get_u8();
14637 *v = val;
14638 }
14639 Ok(__struct)
14640 }
14641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14642 let mut __tmp = BytesMut::new(bytes);
14643 #[allow(clippy::absurd_extreme_comparisons)]
14644 #[allow(unused_comparisons)]
14645 if __tmp.remaining() < Self::ENCODED_LEN {
14646 panic!(
14647 "buffer is too small (need {} bytes, but got {})",
14648 Self::ENCODED_LEN,
14649 __tmp.remaining(),
14650 )
14651 }
14652 __tmp.put_u8(self.target_system);
14653 __tmp.put_u8(self.target_component);
14654 __tmp.put_u8(self.len);
14655 for val in &self.data {
14656 __tmp.put_u8(*val);
14657 }
14658 if matches!(version, MavlinkVersion::V2) {
14659 let len = __tmp.len();
14660 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14661 } else {
14662 __tmp.len()
14663 }
14664 }
14665}
14666#[doc = "id: 232"]
14667#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14668#[derive(Debug, Clone, PartialEq)]
14669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14670#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14671pub struct GPS_INPUT_DATA {
14672 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14673 pub time_usec: u64,
14674 #[doc = "GPS time (from start of GPS week)"]
14675 pub time_week_ms: u32,
14676 #[doc = "Latitude (WGS84)"]
14677 pub lat: i32,
14678 #[doc = "Longitude (WGS84)"]
14679 pub lon: i32,
14680 #[doc = "Altitude (MSL). Positive for up."]
14681 pub alt: f32,
14682 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14683 pub hdop: f32,
14684 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14685 pub vdop: f32,
14686 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14687 pub vn: f32,
14688 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14689 pub ve: f32,
14690 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14691 pub vd: f32,
14692 #[doc = "GPS speed accuracy"]
14693 pub speed_accuracy: f32,
14694 #[doc = "GPS horizontal accuracy"]
14695 pub horiz_accuracy: f32,
14696 #[doc = "GPS vertical accuracy"]
14697 pub vert_accuracy: f32,
14698 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14699 pub ignore_flags: GpsInputIgnoreFlags,
14700 #[doc = "GPS week number"]
14701 pub time_week: u16,
14702 #[doc = "ID of the GPS for multiple GPS inputs"]
14703 pub gps_id: u8,
14704 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14705 pub fix_type: u8,
14706 #[doc = "Number of satellites visible."]
14707 pub satellites_visible: u8,
14708 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14709 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14710 pub yaw: u16,
14711}
14712impl GPS_INPUT_DATA {
14713 pub const ENCODED_LEN: usize = 65usize;
14714 pub const DEFAULT: Self = Self {
14715 time_usec: 0_u64,
14716 time_week_ms: 0_u32,
14717 lat: 0_i32,
14718 lon: 0_i32,
14719 alt: 0.0_f32,
14720 hdop: 0.0_f32,
14721 vdop: 0.0_f32,
14722 vn: 0.0_f32,
14723 ve: 0.0_f32,
14724 vd: 0.0_f32,
14725 speed_accuracy: 0.0_f32,
14726 horiz_accuracy: 0.0_f32,
14727 vert_accuracy: 0.0_f32,
14728 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14729 time_week: 0_u16,
14730 gps_id: 0_u8,
14731 fix_type: 0_u8,
14732 satellites_visible: 0_u8,
14733 yaw: 0_u16,
14734 };
14735 #[cfg(feature = "arbitrary")]
14736 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14737 use arbitrary::{Arbitrary, Unstructured};
14738 let mut buf = [0u8; 1024];
14739 rng.fill_bytes(&mut buf);
14740 let mut unstructured = Unstructured::new(&buf);
14741 Self::arbitrary(&mut unstructured).unwrap_or_default()
14742 }
14743}
14744impl Default for GPS_INPUT_DATA {
14745 fn default() -> Self {
14746 Self::DEFAULT.clone()
14747 }
14748}
14749impl MessageData for GPS_INPUT_DATA {
14750 type Message = MavMessage;
14751 const ID: u32 = 232u32;
14752 const NAME: &'static str = "GPS_INPUT";
14753 const EXTRA_CRC: u8 = 151u8;
14754 const ENCODED_LEN: usize = 65usize;
14755 fn deser(
14756 _version: MavlinkVersion,
14757 __input: &[u8],
14758 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14759 let avail_len = __input.len();
14760 let mut payload_buf = [0; Self::ENCODED_LEN];
14761 let mut buf = if avail_len < Self::ENCODED_LEN {
14762 payload_buf[0..avail_len].copy_from_slice(__input);
14763 Bytes::new(&payload_buf)
14764 } else {
14765 Bytes::new(__input)
14766 };
14767 let mut __struct = Self::default();
14768 __struct.time_usec = buf.get_u64_le();
14769 __struct.time_week_ms = buf.get_u32_le();
14770 __struct.lat = buf.get_i32_le();
14771 __struct.lon = buf.get_i32_le();
14772 __struct.alt = buf.get_f32_le();
14773 __struct.hdop = buf.get_f32_le();
14774 __struct.vdop = buf.get_f32_le();
14775 __struct.vn = buf.get_f32_le();
14776 __struct.ve = buf.get_f32_le();
14777 __struct.vd = buf.get_f32_le();
14778 __struct.speed_accuracy = buf.get_f32_le();
14779 __struct.horiz_accuracy = buf.get_f32_le();
14780 __struct.vert_accuracy = buf.get_f32_le();
14781 let tmp = buf.get_u16_le();
14782 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14783 tmp & GpsInputIgnoreFlags::all().bits(),
14784 )
14785 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14786 flag_type: "GpsInputIgnoreFlags",
14787 value: tmp as u32,
14788 })?;
14789 __struct.time_week = buf.get_u16_le();
14790 __struct.gps_id = buf.get_u8();
14791 __struct.fix_type = buf.get_u8();
14792 __struct.satellites_visible = buf.get_u8();
14793 __struct.yaw = buf.get_u16_le();
14794 Ok(__struct)
14795 }
14796 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14797 let mut __tmp = BytesMut::new(bytes);
14798 #[allow(clippy::absurd_extreme_comparisons)]
14799 #[allow(unused_comparisons)]
14800 if __tmp.remaining() < Self::ENCODED_LEN {
14801 panic!(
14802 "buffer is too small (need {} bytes, but got {})",
14803 Self::ENCODED_LEN,
14804 __tmp.remaining(),
14805 )
14806 }
14807 __tmp.put_u64_le(self.time_usec);
14808 __tmp.put_u32_le(self.time_week_ms);
14809 __tmp.put_i32_le(self.lat);
14810 __tmp.put_i32_le(self.lon);
14811 __tmp.put_f32_le(self.alt);
14812 __tmp.put_f32_le(self.hdop);
14813 __tmp.put_f32_le(self.vdop);
14814 __tmp.put_f32_le(self.vn);
14815 __tmp.put_f32_le(self.ve);
14816 __tmp.put_f32_le(self.vd);
14817 __tmp.put_f32_le(self.speed_accuracy);
14818 __tmp.put_f32_le(self.horiz_accuracy);
14819 __tmp.put_f32_le(self.vert_accuracy);
14820 __tmp.put_u16_le(self.ignore_flags.bits());
14821 __tmp.put_u16_le(self.time_week);
14822 __tmp.put_u8(self.gps_id);
14823 __tmp.put_u8(self.fix_type);
14824 __tmp.put_u8(self.satellites_visible);
14825 __tmp.put_u16_le(self.yaw);
14826 if matches!(version, MavlinkVersion::V2) {
14827 let len = __tmp.len();
14828 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14829 } else {
14830 __tmp.len()
14831 }
14832 }
14833}
14834#[doc = "id: 24"]
14835#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14836#[derive(Debug, Clone, PartialEq)]
14837#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14839pub struct GPS_RAW_INT_DATA {
14840 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14841 pub time_usec: u64,
14842 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14843 pub lat: i32,
14844 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14845 pub lon: i32,
14846 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14847 pub alt: i32,
14848 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14849 pub eph: u16,
14850 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14851 pub epv: u16,
14852 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14853 pub vel: u16,
14854 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14855 pub cog: u16,
14856 #[doc = "GPS fix type."]
14857 pub fix_type: GpsFixType,
14858 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14859 pub satellites_visible: u8,
14860 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14861 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14862 pub alt_ellipsoid: i32,
14863 #[doc = "Position uncertainty."]
14864 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14865 pub h_acc: u32,
14866 #[doc = "Altitude uncertainty."]
14867 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14868 pub v_acc: u32,
14869 #[doc = "Speed uncertainty."]
14870 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14871 pub vel_acc: u32,
14872 #[doc = "Heading / track uncertainty"]
14873 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14874 pub hdg_acc: u32,
14875 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14876 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14877 pub yaw: u16,
14878}
14879impl GPS_RAW_INT_DATA {
14880 pub const ENCODED_LEN: usize = 52usize;
14881 pub const DEFAULT: Self = Self {
14882 time_usec: 0_u64,
14883 lat: 0_i32,
14884 lon: 0_i32,
14885 alt: 0_i32,
14886 eph: 0_u16,
14887 epv: 0_u16,
14888 vel: 0_u16,
14889 cog: 0_u16,
14890 fix_type: GpsFixType::DEFAULT,
14891 satellites_visible: 0_u8,
14892 alt_ellipsoid: 0_i32,
14893 h_acc: 0_u32,
14894 v_acc: 0_u32,
14895 vel_acc: 0_u32,
14896 hdg_acc: 0_u32,
14897 yaw: 0_u16,
14898 };
14899 #[cfg(feature = "arbitrary")]
14900 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14901 use arbitrary::{Arbitrary, Unstructured};
14902 let mut buf = [0u8; 1024];
14903 rng.fill_bytes(&mut buf);
14904 let mut unstructured = Unstructured::new(&buf);
14905 Self::arbitrary(&mut unstructured).unwrap_or_default()
14906 }
14907}
14908impl Default for GPS_RAW_INT_DATA {
14909 fn default() -> Self {
14910 Self::DEFAULT.clone()
14911 }
14912}
14913impl MessageData for GPS_RAW_INT_DATA {
14914 type Message = MavMessage;
14915 const ID: u32 = 24u32;
14916 const NAME: &'static str = "GPS_RAW_INT";
14917 const EXTRA_CRC: u8 = 24u8;
14918 const ENCODED_LEN: usize = 52usize;
14919 fn deser(
14920 _version: MavlinkVersion,
14921 __input: &[u8],
14922 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14923 let avail_len = __input.len();
14924 let mut payload_buf = [0; Self::ENCODED_LEN];
14925 let mut buf = if avail_len < Self::ENCODED_LEN {
14926 payload_buf[0..avail_len].copy_from_slice(__input);
14927 Bytes::new(&payload_buf)
14928 } else {
14929 Bytes::new(__input)
14930 };
14931 let mut __struct = Self::default();
14932 __struct.time_usec = buf.get_u64_le();
14933 __struct.lat = buf.get_i32_le();
14934 __struct.lon = buf.get_i32_le();
14935 __struct.alt = buf.get_i32_le();
14936 __struct.eph = buf.get_u16_le();
14937 __struct.epv = buf.get_u16_le();
14938 __struct.vel = buf.get_u16_le();
14939 __struct.cog = buf.get_u16_le();
14940 let tmp = buf.get_u8();
14941 __struct.fix_type =
14942 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14943 enum_type: "GpsFixType",
14944 value: tmp as u32,
14945 })?;
14946 __struct.satellites_visible = buf.get_u8();
14947 __struct.alt_ellipsoid = buf.get_i32_le();
14948 __struct.h_acc = buf.get_u32_le();
14949 __struct.v_acc = buf.get_u32_le();
14950 __struct.vel_acc = buf.get_u32_le();
14951 __struct.hdg_acc = buf.get_u32_le();
14952 __struct.yaw = buf.get_u16_le();
14953 Ok(__struct)
14954 }
14955 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14956 let mut __tmp = BytesMut::new(bytes);
14957 #[allow(clippy::absurd_extreme_comparisons)]
14958 #[allow(unused_comparisons)]
14959 if __tmp.remaining() < Self::ENCODED_LEN {
14960 panic!(
14961 "buffer is too small (need {} bytes, but got {})",
14962 Self::ENCODED_LEN,
14963 __tmp.remaining(),
14964 )
14965 }
14966 __tmp.put_u64_le(self.time_usec);
14967 __tmp.put_i32_le(self.lat);
14968 __tmp.put_i32_le(self.lon);
14969 __tmp.put_i32_le(self.alt);
14970 __tmp.put_u16_le(self.eph);
14971 __tmp.put_u16_le(self.epv);
14972 __tmp.put_u16_le(self.vel);
14973 __tmp.put_u16_le(self.cog);
14974 __tmp.put_u8(self.fix_type as u8);
14975 __tmp.put_u8(self.satellites_visible);
14976 __tmp.put_i32_le(self.alt_ellipsoid);
14977 __tmp.put_u32_le(self.h_acc);
14978 __tmp.put_u32_le(self.v_acc);
14979 __tmp.put_u32_le(self.vel_acc);
14980 __tmp.put_u32_le(self.hdg_acc);
14981 __tmp.put_u16_le(self.yaw);
14982 if matches!(version, MavlinkVersion::V2) {
14983 let len = __tmp.len();
14984 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14985 } else {
14986 __tmp.len()
14987 }
14988 }
14989}
14990#[doc = "id: 233"]
14991#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14992#[derive(Debug, Clone, PartialEq)]
14993#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14995pub struct GPS_RTCM_DATA_DATA {
14996 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14997 pub flags: u8,
14998 #[doc = "data length"]
14999 pub len: u8,
15000 #[doc = "RTCM message (may be fragmented)"]
15001 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15002 pub data: [u8; 180],
15003}
15004impl GPS_RTCM_DATA_DATA {
15005 pub const ENCODED_LEN: usize = 182usize;
15006 pub const DEFAULT: Self = Self {
15007 flags: 0_u8,
15008 len: 0_u8,
15009 data: [0_u8; 180usize],
15010 };
15011 #[cfg(feature = "arbitrary")]
15012 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15013 use arbitrary::{Arbitrary, Unstructured};
15014 let mut buf = [0u8; 1024];
15015 rng.fill_bytes(&mut buf);
15016 let mut unstructured = Unstructured::new(&buf);
15017 Self::arbitrary(&mut unstructured).unwrap_or_default()
15018 }
15019}
15020impl Default for GPS_RTCM_DATA_DATA {
15021 fn default() -> Self {
15022 Self::DEFAULT.clone()
15023 }
15024}
15025impl MessageData for GPS_RTCM_DATA_DATA {
15026 type Message = MavMessage;
15027 const ID: u32 = 233u32;
15028 const NAME: &'static str = "GPS_RTCM_DATA";
15029 const EXTRA_CRC: u8 = 35u8;
15030 const ENCODED_LEN: usize = 182usize;
15031 fn deser(
15032 _version: MavlinkVersion,
15033 __input: &[u8],
15034 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15035 let avail_len = __input.len();
15036 let mut payload_buf = [0; Self::ENCODED_LEN];
15037 let mut buf = if avail_len < Self::ENCODED_LEN {
15038 payload_buf[0..avail_len].copy_from_slice(__input);
15039 Bytes::new(&payload_buf)
15040 } else {
15041 Bytes::new(__input)
15042 };
15043 let mut __struct = Self::default();
15044 __struct.flags = buf.get_u8();
15045 __struct.len = buf.get_u8();
15046 for v in &mut __struct.data {
15047 let val = buf.get_u8();
15048 *v = val;
15049 }
15050 Ok(__struct)
15051 }
15052 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15053 let mut __tmp = BytesMut::new(bytes);
15054 #[allow(clippy::absurd_extreme_comparisons)]
15055 #[allow(unused_comparisons)]
15056 if __tmp.remaining() < Self::ENCODED_LEN {
15057 panic!(
15058 "buffer is too small (need {} bytes, but got {})",
15059 Self::ENCODED_LEN,
15060 __tmp.remaining(),
15061 )
15062 }
15063 __tmp.put_u8(self.flags);
15064 __tmp.put_u8(self.len);
15065 for val in &self.data {
15066 __tmp.put_u8(*val);
15067 }
15068 if matches!(version, MavlinkVersion::V2) {
15069 let len = __tmp.len();
15070 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15071 } else {
15072 __tmp.len()
15073 }
15074 }
15075}
15076#[doc = "id: 127"]
15077#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
15078#[derive(Debug, Clone, PartialEq)]
15079#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15080#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15081pub struct GPS_RTK_DATA {
15082 #[doc = "Time since boot of last baseline message received."]
15083 pub time_last_baseline_ms: u32,
15084 #[doc = "GPS Time of Week of last baseline"]
15085 pub tow: u32,
15086 #[doc = "Current baseline in ECEF x or NED north component."]
15087 pub baseline_a_mm: i32,
15088 #[doc = "Current baseline in ECEF y or NED east component."]
15089 pub baseline_b_mm: i32,
15090 #[doc = "Current baseline in ECEF z or NED down component."]
15091 pub baseline_c_mm: i32,
15092 #[doc = "Current estimate of baseline accuracy."]
15093 pub accuracy: u32,
15094 #[doc = "Current number of integer ambiguity hypotheses."]
15095 pub iar_num_hypotheses: i32,
15096 #[doc = "GPS Week Number of last baseline"]
15097 pub wn: u16,
15098 #[doc = "Identification of connected RTK receiver."]
15099 pub rtk_receiver_id: u8,
15100 #[doc = "GPS-specific health report for RTK data."]
15101 pub rtk_health: u8,
15102 #[doc = "Rate of baseline messages being received by GPS"]
15103 pub rtk_rate: u8,
15104 #[doc = "Current number of sats used for RTK calculation."]
15105 pub nsats: u8,
15106 #[doc = "Coordinate system of baseline"]
15107 pub baseline_coords_type: RtkBaselineCoordinateSystem,
15108}
15109impl GPS_RTK_DATA {
15110 pub const ENCODED_LEN: usize = 35usize;
15111 pub const DEFAULT: Self = Self {
15112 time_last_baseline_ms: 0_u32,
15113 tow: 0_u32,
15114 baseline_a_mm: 0_i32,
15115 baseline_b_mm: 0_i32,
15116 baseline_c_mm: 0_i32,
15117 accuracy: 0_u32,
15118 iar_num_hypotheses: 0_i32,
15119 wn: 0_u16,
15120 rtk_receiver_id: 0_u8,
15121 rtk_health: 0_u8,
15122 rtk_rate: 0_u8,
15123 nsats: 0_u8,
15124 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
15125 };
15126 #[cfg(feature = "arbitrary")]
15127 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15128 use arbitrary::{Arbitrary, Unstructured};
15129 let mut buf = [0u8; 1024];
15130 rng.fill_bytes(&mut buf);
15131 let mut unstructured = Unstructured::new(&buf);
15132 Self::arbitrary(&mut unstructured).unwrap_or_default()
15133 }
15134}
15135impl Default for GPS_RTK_DATA {
15136 fn default() -> Self {
15137 Self::DEFAULT.clone()
15138 }
15139}
15140impl MessageData for GPS_RTK_DATA {
15141 type Message = MavMessage;
15142 const ID: u32 = 127u32;
15143 const NAME: &'static str = "GPS_RTK";
15144 const EXTRA_CRC: u8 = 25u8;
15145 const ENCODED_LEN: usize = 35usize;
15146 fn deser(
15147 _version: MavlinkVersion,
15148 __input: &[u8],
15149 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15150 let avail_len = __input.len();
15151 let mut payload_buf = [0; Self::ENCODED_LEN];
15152 let mut buf = if avail_len < Self::ENCODED_LEN {
15153 payload_buf[0..avail_len].copy_from_slice(__input);
15154 Bytes::new(&payload_buf)
15155 } else {
15156 Bytes::new(__input)
15157 };
15158 let mut __struct = Self::default();
15159 __struct.time_last_baseline_ms = buf.get_u32_le();
15160 __struct.tow = buf.get_u32_le();
15161 __struct.baseline_a_mm = buf.get_i32_le();
15162 __struct.baseline_b_mm = buf.get_i32_le();
15163 __struct.baseline_c_mm = buf.get_i32_le();
15164 __struct.accuracy = buf.get_u32_le();
15165 __struct.iar_num_hypotheses = buf.get_i32_le();
15166 __struct.wn = buf.get_u16_le();
15167 __struct.rtk_receiver_id = buf.get_u8();
15168 __struct.rtk_health = buf.get_u8();
15169 __struct.rtk_rate = buf.get_u8();
15170 __struct.nsats = buf.get_u8();
15171 let tmp = buf.get_u8();
15172 __struct.baseline_coords_type =
15173 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15174 enum_type: "RtkBaselineCoordinateSystem",
15175 value: tmp as u32,
15176 })?;
15177 Ok(__struct)
15178 }
15179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15180 let mut __tmp = BytesMut::new(bytes);
15181 #[allow(clippy::absurd_extreme_comparisons)]
15182 #[allow(unused_comparisons)]
15183 if __tmp.remaining() < Self::ENCODED_LEN {
15184 panic!(
15185 "buffer is too small (need {} bytes, but got {})",
15186 Self::ENCODED_LEN,
15187 __tmp.remaining(),
15188 )
15189 }
15190 __tmp.put_u32_le(self.time_last_baseline_ms);
15191 __tmp.put_u32_le(self.tow);
15192 __tmp.put_i32_le(self.baseline_a_mm);
15193 __tmp.put_i32_le(self.baseline_b_mm);
15194 __tmp.put_i32_le(self.baseline_c_mm);
15195 __tmp.put_u32_le(self.accuracy);
15196 __tmp.put_i32_le(self.iar_num_hypotheses);
15197 __tmp.put_u16_le(self.wn);
15198 __tmp.put_u8(self.rtk_receiver_id);
15199 __tmp.put_u8(self.rtk_health);
15200 __tmp.put_u8(self.rtk_rate);
15201 __tmp.put_u8(self.nsats);
15202 __tmp.put_u8(self.baseline_coords_type as u8);
15203 if matches!(version, MavlinkVersion::V2) {
15204 let len = __tmp.len();
15205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15206 } else {
15207 __tmp.len()
15208 }
15209 }
15210}
15211#[doc = "id: 25"]
15212#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
15213#[derive(Debug, Clone, PartialEq)]
15214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15216pub struct GPS_STATUS_DATA {
15217 #[doc = "Number of satellites visible"]
15218 pub satellites_visible: u8,
15219 #[doc = "Global satellite ID"]
15220 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15221 pub satellite_prn: [u8; 20],
15222 #[doc = "0: Satellite not used, 1: used for localization"]
15223 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15224 pub satellite_used: [u8; 20],
15225 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
15226 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15227 pub satellite_elevation: [u8; 20],
15228 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
15229 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15230 pub satellite_azimuth: [u8; 20],
15231 #[doc = "Signal to noise ratio of satellite"]
15232 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15233 pub satellite_snr: [u8; 20],
15234}
15235impl GPS_STATUS_DATA {
15236 pub const ENCODED_LEN: usize = 101usize;
15237 pub const DEFAULT: Self = Self {
15238 satellites_visible: 0_u8,
15239 satellite_prn: [0_u8; 20usize],
15240 satellite_used: [0_u8; 20usize],
15241 satellite_elevation: [0_u8; 20usize],
15242 satellite_azimuth: [0_u8; 20usize],
15243 satellite_snr: [0_u8; 20usize],
15244 };
15245 #[cfg(feature = "arbitrary")]
15246 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15247 use arbitrary::{Arbitrary, Unstructured};
15248 let mut buf = [0u8; 1024];
15249 rng.fill_bytes(&mut buf);
15250 let mut unstructured = Unstructured::new(&buf);
15251 Self::arbitrary(&mut unstructured).unwrap_or_default()
15252 }
15253}
15254impl Default for GPS_STATUS_DATA {
15255 fn default() -> Self {
15256 Self::DEFAULT.clone()
15257 }
15258}
15259impl MessageData for GPS_STATUS_DATA {
15260 type Message = MavMessage;
15261 const ID: u32 = 25u32;
15262 const NAME: &'static str = "GPS_STATUS";
15263 const EXTRA_CRC: u8 = 23u8;
15264 const ENCODED_LEN: usize = 101usize;
15265 fn deser(
15266 _version: MavlinkVersion,
15267 __input: &[u8],
15268 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15269 let avail_len = __input.len();
15270 let mut payload_buf = [0; Self::ENCODED_LEN];
15271 let mut buf = if avail_len < Self::ENCODED_LEN {
15272 payload_buf[0..avail_len].copy_from_slice(__input);
15273 Bytes::new(&payload_buf)
15274 } else {
15275 Bytes::new(__input)
15276 };
15277 let mut __struct = Self::default();
15278 __struct.satellites_visible = buf.get_u8();
15279 for v in &mut __struct.satellite_prn {
15280 let val = buf.get_u8();
15281 *v = val;
15282 }
15283 for v in &mut __struct.satellite_used {
15284 let val = buf.get_u8();
15285 *v = val;
15286 }
15287 for v in &mut __struct.satellite_elevation {
15288 let val = buf.get_u8();
15289 *v = val;
15290 }
15291 for v in &mut __struct.satellite_azimuth {
15292 let val = buf.get_u8();
15293 *v = val;
15294 }
15295 for v in &mut __struct.satellite_snr {
15296 let val = buf.get_u8();
15297 *v = val;
15298 }
15299 Ok(__struct)
15300 }
15301 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15302 let mut __tmp = BytesMut::new(bytes);
15303 #[allow(clippy::absurd_extreme_comparisons)]
15304 #[allow(unused_comparisons)]
15305 if __tmp.remaining() < Self::ENCODED_LEN {
15306 panic!(
15307 "buffer is too small (need {} bytes, but got {})",
15308 Self::ENCODED_LEN,
15309 __tmp.remaining(),
15310 )
15311 }
15312 __tmp.put_u8(self.satellites_visible);
15313 for val in &self.satellite_prn {
15314 __tmp.put_u8(*val);
15315 }
15316 for val in &self.satellite_used {
15317 __tmp.put_u8(*val);
15318 }
15319 for val in &self.satellite_elevation {
15320 __tmp.put_u8(*val);
15321 }
15322 for val in &self.satellite_azimuth {
15323 __tmp.put_u8(*val);
15324 }
15325 for val in &self.satellite_snr {
15326 __tmp.put_u8(*val);
15327 }
15328 if matches!(version, MavlinkVersion::V2) {
15329 let len = __tmp.len();
15330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15331 } else {
15332 __tmp.len()
15333 }
15334 }
15335}
15336#[doc = "id: 8014"]
15337#[doc = "Status of GSM modem (connected to onboard computer)."]
15338#[derive(Debug, Clone, PartialEq)]
15339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15340#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15341pub struct GSM_LINK_STATUS_DATA {
15342 #[doc = "Timestamp (of OBC)"]
15343 pub timestamp: u64,
15344 #[doc = "GSM modem used"]
15345 pub gsm_modem_type: GsmModemType,
15346 #[doc = "GSM link type"]
15347 pub gsm_link_type: GsmLinkType,
15348 #[doc = "RSSI as reported by modem (unconverted)"]
15349 pub rssi: u8,
15350 #[doc = "RSRP (LTE) or RSCP (WCDMA) as reported by modem (unconverted)"]
15351 pub rsrp_rscp: u8,
15352 #[doc = "SINR (LTE) or ECIO (WCDMA) as reported by modem (unconverted)"]
15353 pub sinr_ecio: u8,
15354 #[doc = "RSRQ (LTE only) as reported by modem (unconverted)"]
15355 pub rsrq: u8,
15356}
15357impl GSM_LINK_STATUS_DATA {
15358 pub const ENCODED_LEN: usize = 14usize;
15359 pub const DEFAULT: Self = Self {
15360 timestamp: 0_u64,
15361 gsm_modem_type: GsmModemType::DEFAULT,
15362 gsm_link_type: GsmLinkType::DEFAULT,
15363 rssi: 0_u8,
15364 rsrp_rscp: 0_u8,
15365 sinr_ecio: 0_u8,
15366 rsrq: 0_u8,
15367 };
15368 #[cfg(feature = "arbitrary")]
15369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15370 use arbitrary::{Arbitrary, Unstructured};
15371 let mut buf = [0u8; 1024];
15372 rng.fill_bytes(&mut buf);
15373 let mut unstructured = Unstructured::new(&buf);
15374 Self::arbitrary(&mut unstructured).unwrap_or_default()
15375 }
15376}
15377impl Default for GSM_LINK_STATUS_DATA {
15378 fn default() -> Self {
15379 Self::DEFAULT.clone()
15380 }
15381}
15382impl MessageData for GSM_LINK_STATUS_DATA {
15383 type Message = MavMessage;
15384 const ID: u32 = 8014u32;
15385 const NAME: &'static str = "GSM_LINK_STATUS";
15386 const EXTRA_CRC: u8 = 200u8;
15387 const ENCODED_LEN: usize = 14usize;
15388 fn deser(
15389 _version: MavlinkVersion,
15390 __input: &[u8],
15391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15392 let avail_len = __input.len();
15393 let mut payload_buf = [0; Self::ENCODED_LEN];
15394 let mut buf = if avail_len < Self::ENCODED_LEN {
15395 payload_buf[0..avail_len].copy_from_slice(__input);
15396 Bytes::new(&payload_buf)
15397 } else {
15398 Bytes::new(__input)
15399 };
15400 let mut __struct = Self::default();
15401 __struct.timestamp = buf.get_u64_le();
15402 let tmp = buf.get_u8();
15403 __struct.gsm_modem_type =
15404 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15405 enum_type: "GsmModemType",
15406 value: tmp as u32,
15407 })?;
15408 let tmp = buf.get_u8();
15409 __struct.gsm_link_type =
15410 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15411 enum_type: "GsmLinkType",
15412 value: tmp as u32,
15413 })?;
15414 __struct.rssi = buf.get_u8();
15415 __struct.rsrp_rscp = buf.get_u8();
15416 __struct.sinr_ecio = buf.get_u8();
15417 __struct.rsrq = buf.get_u8();
15418 Ok(__struct)
15419 }
15420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15421 let mut __tmp = BytesMut::new(bytes);
15422 #[allow(clippy::absurd_extreme_comparisons)]
15423 #[allow(unused_comparisons)]
15424 if __tmp.remaining() < Self::ENCODED_LEN {
15425 panic!(
15426 "buffer is too small (need {} bytes, but got {})",
15427 Self::ENCODED_LEN,
15428 __tmp.remaining(),
15429 )
15430 }
15431 __tmp.put_u64_le(self.timestamp);
15432 __tmp.put_u8(self.gsm_modem_type as u8);
15433 __tmp.put_u8(self.gsm_link_type as u8);
15434 __tmp.put_u8(self.rssi);
15435 __tmp.put_u8(self.rsrp_rscp);
15436 __tmp.put_u8(self.sinr_ecio);
15437 __tmp.put_u8(self.rsrq);
15438 if matches!(version, MavlinkVersion::V2) {
15439 let len = __tmp.len();
15440 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15441 } else {
15442 __tmp.len()
15443 }
15444 }
15445}
15446#[doc = "id: 0"]
15447#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15448#[derive(Debug, Clone, PartialEq)]
15449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15450#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15451pub struct HEARTBEAT_DATA {
15452 #[doc = "A bitfield for use for autopilot-specific flags"]
15453 pub custom_mode: u32,
15454 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15455 pub mavtype: MavType,
15456 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15457 pub autopilot: MavAutopilot,
15458 #[doc = "System mode bitmap."]
15459 pub base_mode: MavModeFlag,
15460 #[doc = "System status flag."]
15461 pub system_status: MavState,
15462 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15463 pub mavlink_version: u8,
15464}
15465impl HEARTBEAT_DATA {
15466 pub const ENCODED_LEN: usize = 9usize;
15467 pub const DEFAULT: Self = Self {
15468 custom_mode: 0_u32,
15469 mavtype: MavType::DEFAULT,
15470 autopilot: MavAutopilot::DEFAULT,
15471 base_mode: MavModeFlag::DEFAULT,
15472 system_status: MavState::DEFAULT,
15473 mavlink_version: MINOR_MAVLINK_VERSION,
15474 };
15475 #[cfg(feature = "arbitrary")]
15476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15477 use arbitrary::{Arbitrary, Unstructured};
15478 let mut buf = [0u8; 1024];
15479 rng.fill_bytes(&mut buf);
15480 let mut unstructured = Unstructured::new(&buf);
15481 Self::arbitrary(&mut unstructured).unwrap_or_default()
15482 }
15483}
15484impl Default for HEARTBEAT_DATA {
15485 fn default() -> Self {
15486 Self::DEFAULT.clone()
15487 }
15488}
15489impl MessageData for HEARTBEAT_DATA {
15490 type Message = MavMessage;
15491 const ID: u32 = 0u32;
15492 const NAME: &'static str = "HEARTBEAT";
15493 const EXTRA_CRC: u8 = 50u8;
15494 const ENCODED_LEN: usize = 9usize;
15495 fn deser(
15496 _version: MavlinkVersion,
15497 __input: &[u8],
15498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15499 let avail_len = __input.len();
15500 let mut payload_buf = [0; Self::ENCODED_LEN];
15501 let mut buf = if avail_len < Self::ENCODED_LEN {
15502 payload_buf[0..avail_len].copy_from_slice(__input);
15503 Bytes::new(&payload_buf)
15504 } else {
15505 Bytes::new(__input)
15506 };
15507 let mut __struct = Self::default();
15508 __struct.custom_mode = buf.get_u32_le();
15509 let tmp = buf.get_u8();
15510 __struct.mavtype =
15511 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15512 enum_type: "MavType",
15513 value: tmp as u32,
15514 })?;
15515 let tmp = buf.get_u8();
15516 __struct.autopilot =
15517 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15518 enum_type: "MavAutopilot",
15519 value: tmp as u32,
15520 })?;
15521 let tmp = buf.get_u8();
15522 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15523 ::mavlink_core::error::ParserError::InvalidFlag {
15524 flag_type: "MavModeFlag",
15525 value: tmp as u32,
15526 },
15527 )?;
15528 let tmp = buf.get_u8();
15529 __struct.system_status =
15530 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15531 enum_type: "MavState",
15532 value: tmp as u32,
15533 })?;
15534 __struct.mavlink_version = buf.get_u8();
15535 Ok(__struct)
15536 }
15537 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15538 let mut __tmp = BytesMut::new(bytes);
15539 #[allow(clippy::absurd_extreme_comparisons)]
15540 #[allow(unused_comparisons)]
15541 if __tmp.remaining() < Self::ENCODED_LEN {
15542 panic!(
15543 "buffer is too small (need {} bytes, but got {})",
15544 Self::ENCODED_LEN,
15545 __tmp.remaining(),
15546 )
15547 }
15548 __tmp.put_u32_le(self.custom_mode);
15549 __tmp.put_u8(self.mavtype as u8);
15550 __tmp.put_u8(self.autopilot as u8);
15551 __tmp.put_u8(self.base_mode.bits());
15552 __tmp.put_u8(self.system_status as u8);
15553 __tmp.put_u8(self.mavlink_version);
15554 if matches!(version, MavlinkVersion::V2) {
15555 let len = __tmp.len();
15556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15557 } else {
15558 __tmp.len()
15559 }
15560 }
15561}
15562#[doc = "id: 105"]
15563#[doc = "The IMU readings in SI units in NED body frame."]
15564#[derive(Debug, Clone, PartialEq)]
15565#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15567pub struct HIGHRES_IMU_DATA {
15568 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15569 pub time_usec: u64,
15570 #[doc = "X acceleration"]
15571 pub xacc: f32,
15572 #[doc = "Y acceleration"]
15573 pub yacc: f32,
15574 #[doc = "Z acceleration"]
15575 pub zacc: f32,
15576 #[doc = "Angular speed around X axis"]
15577 pub xgyro: f32,
15578 #[doc = "Angular speed around Y axis"]
15579 pub ygyro: f32,
15580 #[doc = "Angular speed around Z axis"]
15581 pub zgyro: f32,
15582 #[doc = "X Magnetic field"]
15583 pub xmag: f32,
15584 #[doc = "Y Magnetic field"]
15585 pub ymag: f32,
15586 #[doc = "Z Magnetic field"]
15587 pub zmag: f32,
15588 #[doc = "Absolute pressure"]
15589 pub abs_pressure: f32,
15590 #[doc = "Differential pressure"]
15591 pub diff_pressure: f32,
15592 #[doc = "Altitude calculated from pressure"]
15593 pub pressure_alt: f32,
15594 #[doc = "Temperature"]
15595 pub temperature: f32,
15596 #[doc = "Bitmap for fields that have updated since last message"]
15597 pub fields_updated: HighresImuUpdatedFlags,
15598 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15599 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15600 pub id: u8,
15601}
15602impl HIGHRES_IMU_DATA {
15603 pub const ENCODED_LEN: usize = 63usize;
15604 pub const DEFAULT: Self = Self {
15605 time_usec: 0_u64,
15606 xacc: 0.0_f32,
15607 yacc: 0.0_f32,
15608 zacc: 0.0_f32,
15609 xgyro: 0.0_f32,
15610 ygyro: 0.0_f32,
15611 zgyro: 0.0_f32,
15612 xmag: 0.0_f32,
15613 ymag: 0.0_f32,
15614 zmag: 0.0_f32,
15615 abs_pressure: 0.0_f32,
15616 diff_pressure: 0.0_f32,
15617 pressure_alt: 0.0_f32,
15618 temperature: 0.0_f32,
15619 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15620 id: 0_u8,
15621 };
15622 #[cfg(feature = "arbitrary")]
15623 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15624 use arbitrary::{Arbitrary, Unstructured};
15625 let mut buf = [0u8; 1024];
15626 rng.fill_bytes(&mut buf);
15627 let mut unstructured = Unstructured::new(&buf);
15628 Self::arbitrary(&mut unstructured).unwrap_or_default()
15629 }
15630}
15631impl Default for HIGHRES_IMU_DATA {
15632 fn default() -> Self {
15633 Self::DEFAULT.clone()
15634 }
15635}
15636impl MessageData for HIGHRES_IMU_DATA {
15637 type Message = MavMessage;
15638 const ID: u32 = 105u32;
15639 const NAME: &'static str = "HIGHRES_IMU";
15640 const EXTRA_CRC: u8 = 93u8;
15641 const ENCODED_LEN: usize = 63usize;
15642 fn deser(
15643 _version: MavlinkVersion,
15644 __input: &[u8],
15645 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15646 let avail_len = __input.len();
15647 let mut payload_buf = [0; Self::ENCODED_LEN];
15648 let mut buf = if avail_len < Self::ENCODED_LEN {
15649 payload_buf[0..avail_len].copy_from_slice(__input);
15650 Bytes::new(&payload_buf)
15651 } else {
15652 Bytes::new(__input)
15653 };
15654 let mut __struct = Self::default();
15655 __struct.time_usec = buf.get_u64_le();
15656 __struct.xacc = buf.get_f32_le();
15657 __struct.yacc = buf.get_f32_le();
15658 __struct.zacc = buf.get_f32_le();
15659 __struct.xgyro = buf.get_f32_le();
15660 __struct.ygyro = buf.get_f32_le();
15661 __struct.zgyro = buf.get_f32_le();
15662 __struct.xmag = buf.get_f32_le();
15663 __struct.ymag = buf.get_f32_le();
15664 __struct.zmag = buf.get_f32_le();
15665 __struct.abs_pressure = buf.get_f32_le();
15666 __struct.diff_pressure = buf.get_f32_le();
15667 __struct.pressure_alt = buf.get_f32_le();
15668 __struct.temperature = buf.get_f32_le();
15669 let tmp = buf.get_u16_le();
15670 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
15671 tmp & HighresImuUpdatedFlags::all().bits(),
15672 )
15673 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15674 flag_type: "HighresImuUpdatedFlags",
15675 value: tmp as u32,
15676 })?;
15677 __struct.id = buf.get_u8();
15678 Ok(__struct)
15679 }
15680 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15681 let mut __tmp = BytesMut::new(bytes);
15682 #[allow(clippy::absurd_extreme_comparisons)]
15683 #[allow(unused_comparisons)]
15684 if __tmp.remaining() < Self::ENCODED_LEN {
15685 panic!(
15686 "buffer is too small (need {} bytes, but got {})",
15687 Self::ENCODED_LEN,
15688 __tmp.remaining(),
15689 )
15690 }
15691 __tmp.put_u64_le(self.time_usec);
15692 __tmp.put_f32_le(self.xacc);
15693 __tmp.put_f32_le(self.yacc);
15694 __tmp.put_f32_le(self.zacc);
15695 __tmp.put_f32_le(self.xgyro);
15696 __tmp.put_f32_le(self.ygyro);
15697 __tmp.put_f32_le(self.zgyro);
15698 __tmp.put_f32_le(self.xmag);
15699 __tmp.put_f32_le(self.ymag);
15700 __tmp.put_f32_le(self.zmag);
15701 __tmp.put_f32_le(self.abs_pressure);
15702 __tmp.put_f32_le(self.diff_pressure);
15703 __tmp.put_f32_le(self.pressure_alt);
15704 __tmp.put_f32_le(self.temperature);
15705 __tmp.put_u16_le(self.fields_updated.bits());
15706 __tmp.put_u8(self.id);
15707 if matches!(version, MavlinkVersion::V2) {
15708 let len = __tmp.len();
15709 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15710 } else {
15711 __tmp.len()
15712 }
15713 }
15714}
15715#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15716#[doc = "id: 234"]
15717#[doc = "Message appropriate for high latency connections like Iridium."]
15718#[derive(Debug, Clone, PartialEq)]
15719#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15720#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15721pub struct HIGH_LATENCY_DATA {
15722 #[doc = "A bitfield for use for autopilot-specific flags."]
15723 pub custom_mode: u32,
15724 #[doc = "Latitude"]
15725 pub latitude: i32,
15726 #[doc = "Longitude"]
15727 pub longitude: i32,
15728 #[doc = "roll"]
15729 pub roll: i16,
15730 #[doc = "pitch"]
15731 pub pitch: i16,
15732 #[doc = "heading"]
15733 pub heading: u16,
15734 #[doc = "heading setpoint"]
15735 pub heading_sp: i16,
15736 #[doc = "Altitude above mean sea level"]
15737 pub altitude_amsl: i16,
15738 #[doc = "Altitude setpoint relative to the home position"]
15739 pub altitude_sp: i16,
15740 #[doc = "distance to target"]
15741 pub wp_distance: u16,
15742 #[doc = "Bitmap of enabled system modes."]
15743 pub base_mode: MavModeFlag,
15744 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15745 pub landed_state: MavLandedState,
15746 #[doc = "throttle (percentage)"]
15747 pub throttle: i8,
15748 #[doc = "airspeed"]
15749 pub airspeed: u8,
15750 #[doc = "airspeed setpoint"]
15751 pub airspeed_sp: u8,
15752 #[doc = "groundspeed"]
15753 pub groundspeed: u8,
15754 #[doc = "climb rate"]
15755 pub climb_rate: i8,
15756 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15757 pub gps_nsat: u8,
15758 #[doc = "GPS Fix type."]
15759 pub gps_fix_type: GpsFixType,
15760 #[doc = "Remaining battery (percentage)"]
15761 pub battery_remaining: u8,
15762 #[doc = "Autopilot temperature (degrees C)"]
15763 pub temperature: i8,
15764 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15765 pub temperature_air: i8,
15766 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15767 pub failsafe: u8,
15768 #[doc = "current waypoint number"]
15769 pub wp_num: u8,
15770}
15771impl HIGH_LATENCY_DATA {
15772 pub const ENCODED_LEN: usize = 40usize;
15773 pub const DEFAULT: Self = Self {
15774 custom_mode: 0_u32,
15775 latitude: 0_i32,
15776 longitude: 0_i32,
15777 roll: 0_i16,
15778 pitch: 0_i16,
15779 heading: 0_u16,
15780 heading_sp: 0_i16,
15781 altitude_amsl: 0_i16,
15782 altitude_sp: 0_i16,
15783 wp_distance: 0_u16,
15784 base_mode: MavModeFlag::DEFAULT,
15785 landed_state: MavLandedState::DEFAULT,
15786 throttle: 0_i8,
15787 airspeed: 0_u8,
15788 airspeed_sp: 0_u8,
15789 groundspeed: 0_u8,
15790 climb_rate: 0_i8,
15791 gps_nsat: 0_u8,
15792 gps_fix_type: GpsFixType::DEFAULT,
15793 battery_remaining: 0_u8,
15794 temperature: 0_i8,
15795 temperature_air: 0_i8,
15796 failsafe: 0_u8,
15797 wp_num: 0_u8,
15798 };
15799 #[cfg(feature = "arbitrary")]
15800 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15801 use arbitrary::{Arbitrary, Unstructured};
15802 let mut buf = [0u8; 1024];
15803 rng.fill_bytes(&mut buf);
15804 let mut unstructured = Unstructured::new(&buf);
15805 Self::arbitrary(&mut unstructured).unwrap_or_default()
15806 }
15807}
15808impl Default for HIGH_LATENCY_DATA {
15809 fn default() -> Self {
15810 Self::DEFAULT.clone()
15811 }
15812}
15813impl MessageData for HIGH_LATENCY_DATA {
15814 type Message = MavMessage;
15815 const ID: u32 = 234u32;
15816 const NAME: &'static str = "HIGH_LATENCY";
15817 const EXTRA_CRC: u8 = 150u8;
15818 const ENCODED_LEN: usize = 40usize;
15819 fn deser(
15820 _version: MavlinkVersion,
15821 __input: &[u8],
15822 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15823 let avail_len = __input.len();
15824 let mut payload_buf = [0; Self::ENCODED_LEN];
15825 let mut buf = if avail_len < Self::ENCODED_LEN {
15826 payload_buf[0..avail_len].copy_from_slice(__input);
15827 Bytes::new(&payload_buf)
15828 } else {
15829 Bytes::new(__input)
15830 };
15831 let mut __struct = Self::default();
15832 __struct.custom_mode = buf.get_u32_le();
15833 __struct.latitude = buf.get_i32_le();
15834 __struct.longitude = buf.get_i32_le();
15835 __struct.roll = buf.get_i16_le();
15836 __struct.pitch = buf.get_i16_le();
15837 __struct.heading = buf.get_u16_le();
15838 __struct.heading_sp = buf.get_i16_le();
15839 __struct.altitude_amsl = buf.get_i16_le();
15840 __struct.altitude_sp = buf.get_i16_le();
15841 __struct.wp_distance = buf.get_u16_le();
15842 let tmp = buf.get_u8();
15843 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15844 ::mavlink_core::error::ParserError::InvalidFlag {
15845 flag_type: "MavModeFlag",
15846 value: tmp as u32,
15847 },
15848 )?;
15849 let tmp = buf.get_u8();
15850 __struct.landed_state =
15851 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15852 enum_type: "MavLandedState",
15853 value: tmp as u32,
15854 })?;
15855 __struct.throttle = buf.get_i8();
15856 __struct.airspeed = buf.get_u8();
15857 __struct.airspeed_sp = buf.get_u8();
15858 __struct.groundspeed = buf.get_u8();
15859 __struct.climb_rate = buf.get_i8();
15860 __struct.gps_nsat = buf.get_u8();
15861 let tmp = buf.get_u8();
15862 __struct.gps_fix_type =
15863 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15864 enum_type: "GpsFixType",
15865 value: tmp as u32,
15866 })?;
15867 __struct.battery_remaining = buf.get_u8();
15868 __struct.temperature = buf.get_i8();
15869 __struct.temperature_air = buf.get_i8();
15870 __struct.failsafe = buf.get_u8();
15871 __struct.wp_num = buf.get_u8();
15872 Ok(__struct)
15873 }
15874 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15875 let mut __tmp = BytesMut::new(bytes);
15876 #[allow(clippy::absurd_extreme_comparisons)]
15877 #[allow(unused_comparisons)]
15878 if __tmp.remaining() < Self::ENCODED_LEN {
15879 panic!(
15880 "buffer is too small (need {} bytes, but got {})",
15881 Self::ENCODED_LEN,
15882 __tmp.remaining(),
15883 )
15884 }
15885 __tmp.put_u32_le(self.custom_mode);
15886 __tmp.put_i32_le(self.latitude);
15887 __tmp.put_i32_le(self.longitude);
15888 __tmp.put_i16_le(self.roll);
15889 __tmp.put_i16_le(self.pitch);
15890 __tmp.put_u16_le(self.heading);
15891 __tmp.put_i16_le(self.heading_sp);
15892 __tmp.put_i16_le(self.altitude_amsl);
15893 __tmp.put_i16_le(self.altitude_sp);
15894 __tmp.put_u16_le(self.wp_distance);
15895 __tmp.put_u8(self.base_mode.bits());
15896 __tmp.put_u8(self.landed_state as u8);
15897 __tmp.put_i8(self.throttle);
15898 __tmp.put_u8(self.airspeed);
15899 __tmp.put_u8(self.airspeed_sp);
15900 __tmp.put_u8(self.groundspeed);
15901 __tmp.put_i8(self.climb_rate);
15902 __tmp.put_u8(self.gps_nsat);
15903 __tmp.put_u8(self.gps_fix_type as u8);
15904 __tmp.put_u8(self.battery_remaining);
15905 __tmp.put_i8(self.temperature);
15906 __tmp.put_i8(self.temperature_air);
15907 __tmp.put_u8(self.failsafe);
15908 __tmp.put_u8(self.wp_num);
15909 if matches!(version, MavlinkVersion::V2) {
15910 let len = __tmp.len();
15911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15912 } else {
15913 __tmp.len()
15914 }
15915 }
15916}
15917#[doc = "id: 235"]
15918#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15919#[derive(Debug, Clone, PartialEq)]
15920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15922pub struct HIGH_LATENCY2_DATA {
15923 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15924 pub timestamp: u32,
15925 #[doc = "Latitude"]
15926 pub latitude: i32,
15927 #[doc = "Longitude"]
15928 pub longitude: i32,
15929 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15930 pub custom_mode: u16,
15931 #[doc = "Altitude above mean sea level"]
15932 pub altitude: i16,
15933 #[doc = "Altitude setpoint"]
15934 pub target_altitude: i16,
15935 #[doc = "Distance to target waypoint or position"]
15936 pub target_distance: u16,
15937 #[doc = "Current waypoint number"]
15938 pub wp_num: u16,
15939 #[doc = "Bitmap of failure flags."]
15940 pub failure_flags: HlFailureFlag,
15941 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15942 pub mavtype: MavType,
15943 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15944 pub autopilot: MavAutopilot,
15945 #[doc = "Heading"]
15946 pub heading: u8,
15947 #[doc = "Heading setpoint"]
15948 pub target_heading: u8,
15949 #[doc = "Throttle"]
15950 pub throttle: u8,
15951 #[doc = "Airspeed"]
15952 pub airspeed: u8,
15953 #[doc = "Airspeed setpoint"]
15954 pub airspeed_sp: u8,
15955 #[doc = "Groundspeed"]
15956 pub groundspeed: u8,
15957 #[doc = "Windspeed"]
15958 pub windspeed: u8,
15959 #[doc = "Wind heading"]
15960 pub wind_heading: u8,
15961 #[doc = "Maximum error horizontal position since last message"]
15962 pub eph: u8,
15963 #[doc = "Maximum error vertical position since last message"]
15964 pub epv: u8,
15965 #[doc = "Air temperature"]
15966 pub temperature_air: i8,
15967 #[doc = "Maximum climb rate magnitude since last message"]
15968 pub climb_rate: i8,
15969 #[doc = "Battery level (-1 if field not provided)."]
15970 pub battery: i8,
15971 #[doc = "Field for custom payload."]
15972 pub custom0: i8,
15973 #[doc = "Field for custom payload."]
15974 pub custom1: i8,
15975 #[doc = "Field for custom payload."]
15976 pub custom2: i8,
15977}
15978impl HIGH_LATENCY2_DATA {
15979 pub const ENCODED_LEN: usize = 42usize;
15980 pub const DEFAULT: Self = Self {
15981 timestamp: 0_u32,
15982 latitude: 0_i32,
15983 longitude: 0_i32,
15984 custom_mode: 0_u16,
15985 altitude: 0_i16,
15986 target_altitude: 0_i16,
15987 target_distance: 0_u16,
15988 wp_num: 0_u16,
15989 failure_flags: HlFailureFlag::DEFAULT,
15990 mavtype: MavType::DEFAULT,
15991 autopilot: MavAutopilot::DEFAULT,
15992 heading: 0_u8,
15993 target_heading: 0_u8,
15994 throttle: 0_u8,
15995 airspeed: 0_u8,
15996 airspeed_sp: 0_u8,
15997 groundspeed: 0_u8,
15998 windspeed: 0_u8,
15999 wind_heading: 0_u8,
16000 eph: 0_u8,
16001 epv: 0_u8,
16002 temperature_air: 0_i8,
16003 climb_rate: 0_i8,
16004 battery: 0_i8,
16005 custom0: 0_i8,
16006 custom1: 0_i8,
16007 custom2: 0_i8,
16008 };
16009 #[cfg(feature = "arbitrary")]
16010 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16011 use arbitrary::{Arbitrary, Unstructured};
16012 let mut buf = [0u8; 1024];
16013 rng.fill_bytes(&mut buf);
16014 let mut unstructured = Unstructured::new(&buf);
16015 Self::arbitrary(&mut unstructured).unwrap_or_default()
16016 }
16017}
16018impl Default for HIGH_LATENCY2_DATA {
16019 fn default() -> Self {
16020 Self::DEFAULT.clone()
16021 }
16022}
16023impl MessageData for HIGH_LATENCY2_DATA {
16024 type Message = MavMessage;
16025 const ID: u32 = 235u32;
16026 const NAME: &'static str = "HIGH_LATENCY2";
16027 const EXTRA_CRC: u8 = 179u8;
16028 const ENCODED_LEN: usize = 42usize;
16029 fn deser(
16030 _version: MavlinkVersion,
16031 __input: &[u8],
16032 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16033 let avail_len = __input.len();
16034 let mut payload_buf = [0; Self::ENCODED_LEN];
16035 let mut buf = if avail_len < Self::ENCODED_LEN {
16036 payload_buf[0..avail_len].copy_from_slice(__input);
16037 Bytes::new(&payload_buf)
16038 } else {
16039 Bytes::new(__input)
16040 };
16041 let mut __struct = Self::default();
16042 __struct.timestamp = buf.get_u32_le();
16043 __struct.latitude = buf.get_i32_le();
16044 __struct.longitude = buf.get_i32_le();
16045 __struct.custom_mode = buf.get_u16_le();
16046 __struct.altitude = buf.get_i16_le();
16047 __struct.target_altitude = buf.get_i16_le();
16048 __struct.target_distance = buf.get_u16_le();
16049 __struct.wp_num = buf.get_u16_le();
16050 let tmp = buf.get_u16_le();
16051 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
16052 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16053 flag_type: "HlFailureFlag",
16054 value: tmp as u32,
16055 })?;
16056 let tmp = buf.get_u8();
16057 __struct.mavtype =
16058 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16059 enum_type: "MavType",
16060 value: tmp as u32,
16061 })?;
16062 let tmp = buf.get_u8();
16063 __struct.autopilot =
16064 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16065 enum_type: "MavAutopilot",
16066 value: tmp as u32,
16067 })?;
16068 __struct.heading = buf.get_u8();
16069 __struct.target_heading = buf.get_u8();
16070 __struct.throttle = buf.get_u8();
16071 __struct.airspeed = buf.get_u8();
16072 __struct.airspeed_sp = buf.get_u8();
16073 __struct.groundspeed = buf.get_u8();
16074 __struct.windspeed = buf.get_u8();
16075 __struct.wind_heading = buf.get_u8();
16076 __struct.eph = buf.get_u8();
16077 __struct.epv = buf.get_u8();
16078 __struct.temperature_air = buf.get_i8();
16079 __struct.climb_rate = buf.get_i8();
16080 __struct.battery = buf.get_i8();
16081 __struct.custom0 = buf.get_i8();
16082 __struct.custom1 = buf.get_i8();
16083 __struct.custom2 = buf.get_i8();
16084 Ok(__struct)
16085 }
16086 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16087 let mut __tmp = BytesMut::new(bytes);
16088 #[allow(clippy::absurd_extreme_comparisons)]
16089 #[allow(unused_comparisons)]
16090 if __tmp.remaining() < Self::ENCODED_LEN {
16091 panic!(
16092 "buffer is too small (need {} bytes, but got {})",
16093 Self::ENCODED_LEN,
16094 __tmp.remaining(),
16095 )
16096 }
16097 __tmp.put_u32_le(self.timestamp);
16098 __tmp.put_i32_le(self.latitude);
16099 __tmp.put_i32_le(self.longitude);
16100 __tmp.put_u16_le(self.custom_mode);
16101 __tmp.put_i16_le(self.altitude);
16102 __tmp.put_i16_le(self.target_altitude);
16103 __tmp.put_u16_le(self.target_distance);
16104 __tmp.put_u16_le(self.wp_num);
16105 __tmp.put_u16_le(self.failure_flags.bits());
16106 __tmp.put_u8(self.mavtype as u8);
16107 __tmp.put_u8(self.autopilot as u8);
16108 __tmp.put_u8(self.heading);
16109 __tmp.put_u8(self.target_heading);
16110 __tmp.put_u8(self.throttle);
16111 __tmp.put_u8(self.airspeed);
16112 __tmp.put_u8(self.airspeed_sp);
16113 __tmp.put_u8(self.groundspeed);
16114 __tmp.put_u8(self.windspeed);
16115 __tmp.put_u8(self.wind_heading);
16116 __tmp.put_u8(self.eph);
16117 __tmp.put_u8(self.epv);
16118 __tmp.put_i8(self.temperature_air);
16119 __tmp.put_i8(self.climb_rate);
16120 __tmp.put_i8(self.battery);
16121 __tmp.put_i8(self.custom0);
16122 __tmp.put_i8(self.custom1);
16123 __tmp.put_i8(self.custom2);
16124 if matches!(version, MavlinkVersion::V2) {
16125 let len = __tmp.len();
16126 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16127 } else {
16128 __tmp.len()
16129 }
16130 }
16131}
16132#[doc = "id: 93"]
16133#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
16134#[derive(Debug, Clone, PartialEq)]
16135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16136#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16137pub struct HIL_ACTUATOR_CONTROLS_DATA {
16138 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16139 pub time_usec: u64,
16140 #[doc = "Flags bitmask."]
16141 pub flags: HilActuatorControlsFlags,
16142 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
16143 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16144 pub controls: [f32; 16],
16145 #[doc = "System mode. Includes arming state."]
16146 pub mode: MavModeFlag,
16147}
16148impl HIL_ACTUATOR_CONTROLS_DATA {
16149 pub const ENCODED_LEN: usize = 81usize;
16150 pub const DEFAULT: Self = Self {
16151 time_usec: 0_u64,
16152 flags: HilActuatorControlsFlags::DEFAULT,
16153 controls: [0.0_f32; 16usize],
16154 mode: MavModeFlag::DEFAULT,
16155 };
16156 #[cfg(feature = "arbitrary")]
16157 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16158 use arbitrary::{Arbitrary, Unstructured};
16159 let mut buf = [0u8; 1024];
16160 rng.fill_bytes(&mut buf);
16161 let mut unstructured = Unstructured::new(&buf);
16162 Self::arbitrary(&mut unstructured).unwrap_or_default()
16163 }
16164}
16165impl Default for HIL_ACTUATOR_CONTROLS_DATA {
16166 fn default() -> Self {
16167 Self::DEFAULT.clone()
16168 }
16169}
16170impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
16171 type Message = MavMessage;
16172 const ID: u32 = 93u32;
16173 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
16174 const EXTRA_CRC: u8 = 47u8;
16175 const ENCODED_LEN: usize = 81usize;
16176 fn deser(
16177 _version: MavlinkVersion,
16178 __input: &[u8],
16179 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16180 let avail_len = __input.len();
16181 let mut payload_buf = [0; Self::ENCODED_LEN];
16182 let mut buf = if avail_len < Self::ENCODED_LEN {
16183 payload_buf[0..avail_len].copy_from_slice(__input);
16184 Bytes::new(&payload_buf)
16185 } else {
16186 Bytes::new(__input)
16187 };
16188 let mut __struct = Self::default();
16189 __struct.time_usec = buf.get_u64_le();
16190 let tmp = buf.get_u64_le();
16191 __struct.flags =
16192 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
16193 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16194 flag_type: "HilActuatorControlsFlags",
16195 value: tmp as u32,
16196 })?;
16197 for v in &mut __struct.controls {
16198 let val = buf.get_f32_le();
16199 *v = val;
16200 }
16201 let tmp = buf.get_u8();
16202 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
16203 ::mavlink_core::error::ParserError::InvalidFlag {
16204 flag_type: "MavModeFlag",
16205 value: tmp as u32,
16206 },
16207 )?;
16208 Ok(__struct)
16209 }
16210 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16211 let mut __tmp = BytesMut::new(bytes);
16212 #[allow(clippy::absurd_extreme_comparisons)]
16213 #[allow(unused_comparisons)]
16214 if __tmp.remaining() < Self::ENCODED_LEN {
16215 panic!(
16216 "buffer is too small (need {} bytes, but got {})",
16217 Self::ENCODED_LEN,
16218 __tmp.remaining(),
16219 )
16220 }
16221 __tmp.put_u64_le(self.time_usec);
16222 __tmp.put_u64_le(self.flags.bits());
16223 for val in &self.controls {
16224 __tmp.put_f32_le(*val);
16225 }
16226 __tmp.put_u8(self.mode.bits());
16227 if matches!(version, MavlinkVersion::V2) {
16228 let len = __tmp.len();
16229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16230 } else {
16231 __tmp.len()
16232 }
16233 }
16234}
16235#[doc = "id: 91"]
16236#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16237#[derive(Debug, Clone, PartialEq)]
16238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16240pub struct HIL_CONTROLS_DATA {
16241 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16242 pub time_usec: u64,
16243 #[doc = "Control output -1 .. 1"]
16244 pub roll_ailerons: f32,
16245 #[doc = "Control output -1 .. 1"]
16246 pub pitch_elevator: f32,
16247 #[doc = "Control output -1 .. 1"]
16248 pub yaw_rudder: f32,
16249 #[doc = "Throttle 0 .. 1"]
16250 pub throttle: f32,
16251 #[doc = "Aux 1, -1 .. 1"]
16252 pub aux1: f32,
16253 #[doc = "Aux 2, -1 .. 1"]
16254 pub aux2: f32,
16255 #[doc = "Aux 3, -1 .. 1"]
16256 pub aux3: f32,
16257 #[doc = "Aux 4, -1 .. 1"]
16258 pub aux4: f32,
16259 #[doc = "System mode."]
16260 pub mode: MavMode,
16261 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16262 pub nav_mode: u8,
16263}
16264impl HIL_CONTROLS_DATA {
16265 pub const ENCODED_LEN: usize = 42usize;
16266 pub const DEFAULT: Self = Self {
16267 time_usec: 0_u64,
16268 roll_ailerons: 0.0_f32,
16269 pitch_elevator: 0.0_f32,
16270 yaw_rudder: 0.0_f32,
16271 throttle: 0.0_f32,
16272 aux1: 0.0_f32,
16273 aux2: 0.0_f32,
16274 aux3: 0.0_f32,
16275 aux4: 0.0_f32,
16276 mode: MavMode::DEFAULT,
16277 nav_mode: 0_u8,
16278 };
16279 #[cfg(feature = "arbitrary")]
16280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16281 use arbitrary::{Arbitrary, Unstructured};
16282 let mut buf = [0u8; 1024];
16283 rng.fill_bytes(&mut buf);
16284 let mut unstructured = Unstructured::new(&buf);
16285 Self::arbitrary(&mut unstructured).unwrap_or_default()
16286 }
16287}
16288impl Default for HIL_CONTROLS_DATA {
16289 fn default() -> Self {
16290 Self::DEFAULT.clone()
16291 }
16292}
16293impl MessageData for HIL_CONTROLS_DATA {
16294 type Message = MavMessage;
16295 const ID: u32 = 91u32;
16296 const NAME: &'static str = "HIL_CONTROLS";
16297 const EXTRA_CRC: u8 = 63u8;
16298 const ENCODED_LEN: usize = 42usize;
16299 fn deser(
16300 _version: MavlinkVersion,
16301 __input: &[u8],
16302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16303 let avail_len = __input.len();
16304 let mut payload_buf = [0; Self::ENCODED_LEN];
16305 let mut buf = if avail_len < Self::ENCODED_LEN {
16306 payload_buf[0..avail_len].copy_from_slice(__input);
16307 Bytes::new(&payload_buf)
16308 } else {
16309 Bytes::new(__input)
16310 };
16311 let mut __struct = Self::default();
16312 __struct.time_usec = buf.get_u64_le();
16313 __struct.roll_ailerons = buf.get_f32_le();
16314 __struct.pitch_elevator = buf.get_f32_le();
16315 __struct.yaw_rudder = buf.get_f32_le();
16316 __struct.throttle = buf.get_f32_le();
16317 __struct.aux1 = buf.get_f32_le();
16318 __struct.aux2 = buf.get_f32_le();
16319 __struct.aux3 = buf.get_f32_le();
16320 __struct.aux4 = buf.get_f32_le();
16321 let tmp = buf.get_u8();
16322 __struct.mode =
16323 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16324 enum_type: "MavMode",
16325 value: tmp as u32,
16326 })?;
16327 __struct.nav_mode = buf.get_u8();
16328 Ok(__struct)
16329 }
16330 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16331 let mut __tmp = BytesMut::new(bytes);
16332 #[allow(clippy::absurd_extreme_comparisons)]
16333 #[allow(unused_comparisons)]
16334 if __tmp.remaining() < Self::ENCODED_LEN {
16335 panic!(
16336 "buffer is too small (need {} bytes, but got {})",
16337 Self::ENCODED_LEN,
16338 __tmp.remaining(),
16339 )
16340 }
16341 __tmp.put_u64_le(self.time_usec);
16342 __tmp.put_f32_le(self.roll_ailerons);
16343 __tmp.put_f32_le(self.pitch_elevator);
16344 __tmp.put_f32_le(self.yaw_rudder);
16345 __tmp.put_f32_le(self.throttle);
16346 __tmp.put_f32_le(self.aux1);
16347 __tmp.put_f32_le(self.aux2);
16348 __tmp.put_f32_le(self.aux3);
16349 __tmp.put_f32_le(self.aux4);
16350 __tmp.put_u8(self.mode as u8);
16351 __tmp.put_u8(self.nav_mode);
16352 if matches!(version, MavlinkVersion::V2) {
16353 let len = __tmp.len();
16354 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16355 } else {
16356 __tmp.len()
16357 }
16358 }
16359}
16360#[doc = "id: 113"]
16361#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16362#[derive(Debug, Clone, PartialEq)]
16363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16364#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16365pub struct HIL_GPS_DATA {
16366 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16367 pub time_usec: u64,
16368 #[doc = "Latitude (WGS84)"]
16369 pub lat: i32,
16370 #[doc = "Longitude (WGS84)"]
16371 pub lon: i32,
16372 #[doc = "Altitude (MSL). Positive for up."]
16373 pub alt: i32,
16374 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16375 pub eph: u16,
16376 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16377 pub epv: u16,
16378 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16379 pub vel: u16,
16380 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16381 pub vn: i16,
16382 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16383 pub ve: i16,
16384 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16385 pub vd: i16,
16386 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16387 pub cog: u16,
16388 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16389 pub fix_type: u8,
16390 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16391 pub satellites_visible: u8,
16392 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16393 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16394 pub id: u8,
16395 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16396 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16397 pub yaw: u16,
16398}
16399impl HIL_GPS_DATA {
16400 pub const ENCODED_LEN: usize = 39usize;
16401 pub const DEFAULT: Self = Self {
16402 time_usec: 0_u64,
16403 lat: 0_i32,
16404 lon: 0_i32,
16405 alt: 0_i32,
16406 eph: 0_u16,
16407 epv: 0_u16,
16408 vel: 0_u16,
16409 vn: 0_i16,
16410 ve: 0_i16,
16411 vd: 0_i16,
16412 cog: 0_u16,
16413 fix_type: 0_u8,
16414 satellites_visible: 0_u8,
16415 id: 0_u8,
16416 yaw: 0_u16,
16417 };
16418 #[cfg(feature = "arbitrary")]
16419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16420 use arbitrary::{Arbitrary, Unstructured};
16421 let mut buf = [0u8; 1024];
16422 rng.fill_bytes(&mut buf);
16423 let mut unstructured = Unstructured::new(&buf);
16424 Self::arbitrary(&mut unstructured).unwrap_or_default()
16425 }
16426}
16427impl Default for HIL_GPS_DATA {
16428 fn default() -> Self {
16429 Self::DEFAULT.clone()
16430 }
16431}
16432impl MessageData for HIL_GPS_DATA {
16433 type Message = MavMessage;
16434 const ID: u32 = 113u32;
16435 const NAME: &'static str = "HIL_GPS";
16436 const EXTRA_CRC: u8 = 124u8;
16437 const ENCODED_LEN: usize = 39usize;
16438 fn deser(
16439 _version: MavlinkVersion,
16440 __input: &[u8],
16441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16442 let avail_len = __input.len();
16443 let mut payload_buf = [0; Self::ENCODED_LEN];
16444 let mut buf = if avail_len < Self::ENCODED_LEN {
16445 payload_buf[0..avail_len].copy_from_slice(__input);
16446 Bytes::new(&payload_buf)
16447 } else {
16448 Bytes::new(__input)
16449 };
16450 let mut __struct = Self::default();
16451 __struct.time_usec = buf.get_u64_le();
16452 __struct.lat = buf.get_i32_le();
16453 __struct.lon = buf.get_i32_le();
16454 __struct.alt = buf.get_i32_le();
16455 __struct.eph = buf.get_u16_le();
16456 __struct.epv = buf.get_u16_le();
16457 __struct.vel = buf.get_u16_le();
16458 __struct.vn = buf.get_i16_le();
16459 __struct.ve = buf.get_i16_le();
16460 __struct.vd = buf.get_i16_le();
16461 __struct.cog = buf.get_u16_le();
16462 __struct.fix_type = buf.get_u8();
16463 __struct.satellites_visible = buf.get_u8();
16464 __struct.id = buf.get_u8();
16465 __struct.yaw = buf.get_u16_le();
16466 Ok(__struct)
16467 }
16468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16469 let mut __tmp = BytesMut::new(bytes);
16470 #[allow(clippy::absurd_extreme_comparisons)]
16471 #[allow(unused_comparisons)]
16472 if __tmp.remaining() < Self::ENCODED_LEN {
16473 panic!(
16474 "buffer is too small (need {} bytes, but got {})",
16475 Self::ENCODED_LEN,
16476 __tmp.remaining(),
16477 )
16478 }
16479 __tmp.put_u64_le(self.time_usec);
16480 __tmp.put_i32_le(self.lat);
16481 __tmp.put_i32_le(self.lon);
16482 __tmp.put_i32_le(self.alt);
16483 __tmp.put_u16_le(self.eph);
16484 __tmp.put_u16_le(self.epv);
16485 __tmp.put_u16_le(self.vel);
16486 __tmp.put_i16_le(self.vn);
16487 __tmp.put_i16_le(self.ve);
16488 __tmp.put_i16_le(self.vd);
16489 __tmp.put_u16_le(self.cog);
16490 __tmp.put_u8(self.fix_type);
16491 __tmp.put_u8(self.satellites_visible);
16492 __tmp.put_u8(self.id);
16493 __tmp.put_u16_le(self.yaw);
16494 if matches!(version, MavlinkVersion::V2) {
16495 let len = __tmp.len();
16496 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16497 } else {
16498 __tmp.len()
16499 }
16500 }
16501}
16502#[doc = "id: 114"]
16503#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16504#[derive(Debug, Clone, PartialEq)]
16505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16507pub struct HIL_OPTICAL_FLOW_DATA {
16508 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16509 pub time_usec: u64,
16510 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16511 pub integration_time_us: u32,
16512 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16513 pub integrated_x: f32,
16514 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16515 pub integrated_y: f32,
16516 #[doc = "RH rotation around X axis"]
16517 pub integrated_xgyro: f32,
16518 #[doc = "RH rotation around Y axis"]
16519 pub integrated_ygyro: f32,
16520 #[doc = "RH rotation around Z axis"]
16521 pub integrated_zgyro: f32,
16522 #[doc = "Time since the distance was sampled."]
16523 pub time_delta_distance_us: u32,
16524 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16525 pub distance: f32,
16526 #[doc = "Temperature"]
16527 pub temperature: i16,
16528 #[doc = "Sensor ID"]
16529 pub sensor_id: u8,
16530 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16531 pub quality: u8,
16532}
16533impl HIL_OPTICAL_FLOW_DATA {
16534 pub const ENCODED_LEN: usize = 44usize;
16535 pub const DEFAULT: Self = Self {
16536 time_usec: 0_u64,
16537 integration_time_us: 0_u32,
16538 integrated_x: 0.0_f32,
16539 integrated_y: 0.0_f32,
16540 integrated_xgyro: 0.0_f32,
16541 integrated_ygyro: 0.0_f32,
16542 integrated_zgyro: 0.0_f32,
16543 time_delta_distance_us: 0_u32,
16544 distance: 0.0_f32,
16545 temperature: 0_i16,
16546 sensor_id: 0_u8,
16547 quality: 0_u8,
16548 };
16549 #[cfg(feature = "arbitrary")]
16550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16551 use arbitrary::{Arbitrary, Unstructured};
16552 let mut buf = [0u8; 1024];
16553 rng.fill_bytes(&mut buf);
16554 let mut unstructured = Unstructured::new(&buf);
16555 Self::arbitrary(&mut unstructured).unwrap_or_default()
16556 }
16557}
16558impl Default for HIL_OPTICAL_FLOW_DATA {
16559 fn default() -> Self {
16560 Self::DEFAULT.clone()
16561 }
16562}
16563impl MessageData for HIL_OPTICAL_FLOW_DATA {
16564 type Message = MavMessage;
16565 const ID: u32 = 114u32;
16566 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16567 const EXTRA_CRC: u8 = 237u8;
16568 const ENCODED_LEN: usize = 44usize;
16569 fn deser(
16570 _version: MavlinkVersion,
16571 __input: &[u8],
16572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16573 let avail_len = __input.len();
16574 let mut payload_buf = [0; Self::ENCODED_LEN];
16575 let mut buf = if avail_len < Self::ENCODED_LEN {
16576 payload_buf[0..avail_len].copy_from_slice(__input);
16577 Bytes::new(&payload_buf)
16578 } else {
16579 Bytes::new(__input)
16580 };
16581 let mut __struct = Self::default();
16582 __struct.time_usec = buf.get_u64_le();
16583 __struct.integration_time_us = buf.get_u32_le();
16584 __struct.integrated_x = buf.get_f32_le();
16585 __struct.integrated_y = buf.get_f32_le();
16586 __struct.integrated_xgyro = buf.get_f32_le();
16587 __struct.integrated_ygyro = buf.get_f32_le();
16588 __struct.integrated_zgyro = buf.get_f32_le();
16589 __struct.time_delta_distance_us = buf.get_u32_le();
16590 __struct.distance = buf.get_f32_le();
16591 __struct.temperature = buf.get_i16_le();
16592 __struct.sensor_id = buf.get_u8();
16593 __struct.quality = buf.get_u8();
16594 Ok(__struct)
16595 }
16596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16597 let mut __tmp = BytesMut::new(bytes);
16598 #[allow(clippy::absurd_extreme_comparisons)]
16599 #[allow(unused_comparisons)]
16600 if __tmp.remaining() < Self::ENCODED_LEN {
16601 panic!(
16602 "buffer is too small (need {} bytes, but got {})",
16603 Self::ENCODED_LEN,
16604 __tmp.remaining(),
16605 )
16606 }
16607 __tmp.put_u64_le(self.time_usec);
16608 __tmp.put_u32_le(self.integration_time_us);
16609 __tmp.put_f32_le(self.integrated_x);
16610 __tmp.put_f32_le(self.integrated_y);
16611 __tmp.put_f32_le(self.integrated_xgyro);
16612 __tmp.put_f32_le(self.integrated_ygyro);
16613 __tmp.put_f32_le(self.integrated_zgyro);
16614 __tmp.put_u32_le(self.time_delta_distance_us);
16615 __tmp.put_f32_le(self.distance);
16616 __tmp.put_i16_le(self.temperature);
16617 __tmp.put_u8(self.sensor_id);
16618 __tmp.put_u8(self.quality);
16619 if matches!(version, MavlinkVersion::V2) {
16620 let len = __tmp.len();
16621 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16622 } else {
16623 __tmp.len()
16624 }
16625 }
16626}
16627#[doc = "id: 92"]
16628#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16629#[derive(Debug, Clone, PartialEq)]
16630#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16631#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16632pub struct HIL_RC_INPUTS_RAW_DATA {
16633 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16634 pub time_usec: u64,
16635 #[doc = "RC channel 1 value"]
16636 pub chan1_raw: u16,
16637 #[doc = "RC channel 2 value"]
16638 pub chan2_raw: u16,
16639 #[doc = "RC channel 3 value"]
16640 pub chan3_raw: u16,
16641 #[doc = "RC channel 4 value"]
16642 pub chan4_raw: u16,
16643 #[doc = "RC channel 5 value"]
16644 pub chan5_raw: u16,
16645 #[doc = "RC channel 6 value"]
16646 pub chan6_raw: u16,
16647 #[doc = "RC channel 7 value"]
16648 pub chan7_raw: u16,
16649 #[doc = "RC channel 8 value"]
16650 pub chan8_raw: u16,
16651 #[doc = "RC channel 9 value"]
16652 pub chan9_raw: u16,
16653 #[doc = "RC channel 10 value"]
16654 pub chan10_raw: u16,
16655 #[doc = "RC channel 11 value"]
16656 pub chan11_raw: u16,
16657 #[doc = "RC channel 12 value"]
16658 pub chan12_raw: u16,
16659 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16660 pub rssi: u8,
16661}
16662impl HIL_RC_INPUTS_RAW_DATA {
16663 pub const ENCODED_LEN: usize = 33usize;
16664 pub const DEFAULT: Self = Self {
16665 time_usec: 0_u64,
16666 chan1_raw: 0_u16,
16667 chan2_raw: 0_u16,
16668 chan3_raw: 0_u16,
16669 chan4_raw: 0_u16,
16670 chan5_raw: 0_u16,
16671 chan6_raw: 0_u16,
16672 chan7_raw: 0_u16,
16673 chan8_raw: 0_u16,
16674 chan9_raw: 0_u16,
16675 chan10_raw: 0_u16,
16676 chan11_raw: 0_u16,
16677 chan12_raw: 0_u16,
16678 rssi: 0_u8,
16679 };
16680 #[cfg(feature = "arbitrary")]
16681 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16682 use arbitrary::{Arbitrary, Unstructured};
16683 let mut buf = [0u8; 1024];
16684 rng.fill_bytes(&mut buf);
16685 let mut unstructured = Unstructured::new(&buf);
16686 Self::arbitrary(&mut unstructured).unwrap_or_default()
16687 }
16688}
16689impl Default for HIL_RC_INPUTS_RAW_DATA {
16690 fn default() -> Self {
16691 Self::DEFAULT.clone()
16692 }
16693}
16694impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16695 type Message = MavMessage;
16696 const ID: u32 = 92u32;
16697 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16698 const EXTRA_CRC: u8 = 54u8;
16699 const ENCODED_LEN: usize = 33usize;
16700 fn deser(
16701 _version: MavlinkVersion,
16702 __input: &[u8],
16703 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16704 let avail_len = __input.len();
16705 let mut payload_buf = [0; Self::ENCODED_LEN];
16706 let mut buf = if avail_len < Self::ENCODED_LEN {
16707 payload_buf[0..avail_len].copy_from_slice(__input);
16708 Bytes::new(&payload_buf)
16709 } else {
16710 Bytes::new(__input)
16711 };
16712 let mut __struct = Self::default();
16713 __struct.time_usec = buf.get_u64_le();
16714 __struct.chan1_raw = buf.get_u16_le();
16715 __struct.chan2_raw = buf.get_u16_le();
16716 __struct.chan3_raw = buf.get_u16_le();
16717 __struct.chan4_raw = buf.get_u16_le();
16718 __struct.chan5_raw = buf.get_u16_le();
16719 __struct.chan6_raw = buf.get_u16_le();
16720 __struct.chan7_raw = buf.get_u16_le();
16721 __struct.chan8_raw = buf.get_u16_le();
16722 __struct.chan9_raw = buf.get_u16_le();
16723 __struct.chan10_raw = buf.get_u16_le();
16724 __struct.chan11_raw = buf.get_u16_le();
16725 __struct.chan12_raw = buf.get_u16_le();
16726 __struct.rssi = buf.get_u8();
16727 Ok(__struct)
16728 }
16729 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16730 let mut __tmp = BytesMut::new(bytes);
16731 #[allow(clippy::absurd_extreme_comparisons)]
16732 #[allow(unused_comparisons)]
16733 if __tmp.remaining() < Self::ENCODED_LEN {
16734 panic!(
16735 "buffer is too small (need {} bytes, but got {})",
16736 Self::ENCODED_LEN,
16737 __tmp.remaining(),
16738 )
16739 }
16740 __tmp.put_u64_le(self.time_usec);
16741 __tmp.put_u16_le(self.chan1_raw);
16742 __tmp.put_u16_le(self.chan2_raw);
16743 __tmp.put_u16_le(self.chan3_raw);
16744 __tmp.put_u16_le(self.chan4_raw);
16745 __tmp.put_u16_le(self.chan5_raw);
16746 __tmp.put_u16_le(self.chan6_raw);
16747 __tmp.put_u16_le(self.chan7_raw);
16748 __tmp.put_u16_le(self.chan8_raw);
16749 __tmp.put_u16_le(self.chan9_raw);
16750 __tmp.put_u16_le(self.chan10_raw);
16751 __tmp.put_u16_le(self.chan11_raw);
16752 __tmp.put_u16_le(self.chan12_raw);
16753 __tmp.put_u8(self.rssi);
16754 if matches!(version, MavlinkVersion::V2) {
16755 let len = __tmp.len();
16756 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16757 } else {
16758 __tmp.len()
16759 }
16760 }
16761}
16762#[doc = "id: 107"]
16763#[doc = "The IMU readings in SI units in NED body frame."]
16764#[derive(Debug, Clone, PartialEq)]
16765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16766#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16767pub struct HIL_SENSOR_DATA {
16768 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16769 pub time_usec: u64,
16770 #[doc = "X acceleration"]
16771 pub xacc: f32,
16772 #[doc = "Y acceleration"]
16773 pub yacc: f32,
16774 #[doc = "Z acceleration"]
16775 pub zacc: f32,
16776 #[doc = "Angular speed around X axis in body frame"]
16777 pub xgyro: f32,
16778 #[doc = "Angular speed around Y axis in body frame"]
16779 pub ygyro: f32,
16780 #[doc = "Angular speed around Z axis in body frame"]
16781 pub zgyro: f32,
16782 #[doc = "X Magnetic field"]
16783 pub xmag: f32,
16784 #[doc = "Y Magnetic field"]
16785 pub ymag: f32,
16786 #[doc = "Z Magnetic field"]
16787 pub zmag: f32,
16788 #[doc = "Absolute pressure"]
16789 pub abs_pressure: f32,
16790 #[doc = "Differential pressure (airspeed)"]
16791 pub diff_pressure: f32,
16792 #[doc = "Altitude calculated from pressure"]
16793 pub pressure_alt: f32,
16794 #[doc = "Temperature"]
16795 pub temperature: f32,
16796 #[doc = "Bitmap for fields that have updated since last message"]
16797 pub fields_updated: HilSensorUpdatedFlags,
16798 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16799 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16800 pub id: u8,
16801}
16802impl HIL_SENSOR_DATA {
16803 pub const ENCODED_LEN: usize = 65usize;
16804 pub const DEFAULT: Self = Self {
16805 time_usec: 0_u64,
16806 xacc: 0.0_f32,
16807 yacc: 0.0_f32,
16808 zacc: 0.0_f32,
16809 xgyro: 0.0_f32,
16810 ygyro: 0.0_f32,
16811 zgyro: 0.0_f32,
16812 xmag: 0.0_f32,
16813 ymag: 0.0_f32,
16814 zmag: 0.0_f32,
16815 abs_pressure: 0.0_f32,
16816 diff_pressure: 0.0_f32,
16817 pressure_alt: 0.0_f32,
16818 temperature: 0.0_f32,
16819 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16820 id: 0_u8,
16821 };
16822 #[cfg(feature = "arbitrary")]
16823 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16824 use arbitrary::{Arbitrary, Unstructured};
16825 let mut buf = [0u8; 1024];
16826 rng.fill_bytes(&mut buf);
16827 let mut unstructured = Unstructured::new(&buf);
16828 Self::arbitrary(&mut unstructured).unwrap_or_default()
16829 }
16830}
16831impl Default for HIL_SENSOR_DATA {
16832 fn default() -> Self {
16833 Self::DEFAULT.clone()
16834 }
16835}
16836impl MessageData for HIL_SENSOR_DATA {
16837 type Message = MavMessage;
16838 const ID: u32 = 107u32;
16839 const NAME: &'static str = "HIL_SENSOR";
16840 const EXTRA_CRC: u8 = 108u8;
16841 const ENCODED_LEN: usize = 65usize;
16842 fn deser(
16843 _version: MavlinkVersion,
16844 __input: &[u8],
16845 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16846 let avail_len = __input.len();
16847 let mut payload_buf = [0; Self::ENCODED_LEN];
16848 let mut buf = if avail_len < Self::ENCODED_LEN {
16849 payload_buf[0..avail_len].copy_from_slice(__input);
16850 Bytes::new(&payload_buf)
16851 } else {
16852 Bytes::new(__input)
16853 };
16854 let mut __struct = Self::default();
16855 __struct.time_usec = buf.get_u64_le();
16856 __struct.xacc = buf.get_f32_le();
16857 __struct.yacc = buf.get_f32_le();
16858 __struct.zacc = buf.get_f32_le();
16859 __struct.xgyro = buf.get_f32_le();
16860 __struct.ygyro = buf.get_f32_le();
16861 __struct.zgyro = buf.get_f32_le();
16862 __struct.xmag = buf.get_f32_le();
16863 __struct.ymag = buf.get_f32_le();
16864 __struct.zmag = buf.get_f32_le();
16865 __struct.abs_pressure = buf.get_f32_le();
16866 __struct.diff_pressure = buf.get_f32_le();
16867 __struct.pressure_alt = buf.get_f32_le();
16868 __struct.temperature = buf.get_f32_le();
16869 let tmp = buf.get_u32_le();
16870 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16871 tmp & HilSensorUpdatedFlags::all().bits(),
16872 )
16873 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16874 flag_type: "HilSensorUpdatedFlags",
16875 value: tmp as u32,
16876 })?;
16877 __struct.id = buf.get_u8();
16878 Ok(__struct)
16879 }
16880 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16881 let mut __tmp = BytesMut::new(bytes);
16882 #[allow(clippy::absurd_extreme_comparisons)]
16883 #[allow(unused_comparisons)]
16884 if __tmp.remaining() < Self::ENCODED_LEN {
16885 panic!(
16886 "buffer is too small (need {} bytes, but got {})",
16887 Self::ENCODED_LEN,
16888 __tmp.remaining(),
16889 )
16890 }
16891 __tmp.put_u64_le(self.time_usec);
16892 __tmp.put_f32_le(self.xacc);
16893 __tmp.put_f32_le(self.yacc);
16894 __tmp.put_f32_le(self.zacc);
16895 __tmp.put_f32_le(self.xgyro);
16896 __tmp.put_f32_le(self.ygyro);
16897 __tmp.put_f32_le(self.zgyro);
16898 __tmp.put_f32_le(self.xmag);
16899 __tmp.put_f32_le(self.ymag);
16900 __tmp.put_f32_le(self.zmag);
16901 __tmp.put_f32_le(self.abs_pressure);
16902 __tmp.put_f32_le(self.diff_pressure);
16903 __tmp.put_f32_le(self.pressure_alt);
16904 __tmp.put_f32_le(self.temperature);
16905 __tmp.put_u32_le(self.fields_updated.bits());
16906 __tmp.put_u8(self.id);
16907 if matches!(version, MavlinkVersion::V2) {
16908 let len = __tmp.len();
16909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16910 } else {
16911 __tmp.len()
16912 }
16913 }
16914}
16915#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16916#[doc = "id: 90"]
16917#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16918#[derive(Debug, Clone, PartialEq)]
16919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16921pub struct HIL_STATE_DATA {
16922 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16923 pub time_usec: u64,
16924 #[doc = "Roll angle"]
16925 pub roll: f32,
16926 #[doc = "Pitch angle"]
16927 pub pitch: f32,
16928 #[doc = "Yaw angle"]
16929 pub yaw: f32,
16930 #[doc = "Body frame roll / phi angular speed"]
16931 pub rollspeed: f32,
16932 #[doc = "Body frame pitch / theta angular speed"]
16933 pub pitchspeed: f32,
16934 #[doc = "Body frame yaw / psi angular speed"]
16935 pub yawspeed: f32,
16936 #[doc = "Latitude"]
16937 pub lat: i32,
16938 #[doc = "Longitude"]
16939 pub lon: i32,
16940 #[doc = "Altitude"]
16941 pub alt: i32,
16942 #[doc = "Ground X Speed (Latitude)"]
16943 pub vx: i16,
16944 #[doc = "Ground Y Speed (Longitude)"]
16945 pub vy: i16,
16946 #[doc = "Ground Z Speed (Altitude)"]
16947 pub vz: i16,
16948 #[doc = "X acceleration"]
16949 pub xacc: i16,
16950 #[doc = "Y acceleration"]
16951 pub yacc: i16,
16952 #[doc = "Z acceleration"]
16953 pub zacc: i16,
16954}
16955impl HIL_STATE_DATA {
16956 pub const ENCODED_LEN: usize = 56usize;
16957 pub const DEFAULT: Self = Self {
16958 time_usec: 0_u64,
16959 roll: 0.0_f32,
16960 pitch: 0.0_f32,
16961 yaw: 0.0_f32,
16962 rollspeed: 0.0_f32,
16963 pitchspeed: 0.0_f32,
16964 yawspeed: 0.0_f32,
16965 lat: 0_i32,
16966 lon: 0_i32,
16967 alt: 0_i32,
16968 vx: 0_i16,
16969 vy: 0_i16,
16970 vz: 0_i16,
16971 xacc: 0_i16,
16972 yacc: 0_i16,
16973 zacc: 0_i16,
16974 };
16975 #[cfg(feature = "arbitrary")]
16976 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16977 use arbitrary::{Arbitrary, Unstructured};
16978 let mut buf = [0u8; 1024];
16979 rng.fill_bytes(&mut buf);
16980 let mut unstructured = Unstructured::new(&buf);
16981 Self::arbitrary(&mut unstructured).unwrap_or_default()
16982 }
16983}
16984impl Default for HIL_STATE_DATA {
16985 fn default() -> Self {
16986 Self::DEFAULT.clone()
16987 }
16988}
16989impl MessageData for HIL_STATE_DATA {
16990 type Message = MavMessage;
16991 const ID: u32 = 90u32;
16992 const NAME: &'static str = "HIL_STATE";
16993 const EXTRA_CRC: u8 = 183u8;
16994 const ENCODED_LEN: usize = 56usize;
16995 fn deser(
16996 _version: MavlinkVersion,
16997 __input: &[u8],
16998 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16999 let avail_len = __input.len();
17000 let mut payload_buf = [0; Self::ENCODED_LEN];
17001 let mut buf = if avail_len < Self::ENCODED_LEN {
17002 payload_buf[0..avail_len].copy_from_slice(__input);
17003 Bytes::new(&payload_buf)
17004 } else {
17005 Bytes::new(__input)
17006 };
17007 let mut __struct = Self::default();
17008 __struct.time_usec = buf.get_u64_le();
17009 __struct.roll = buf.get_f32_le();
17010 __struct.pitch = buf.get_f32_le();
17011 __struct.yaw = buf.get_f32_le();
17012 __struct.rollspeed = buf.get_f32_le();
17013 __struct.pitchspeed = buf.get_f32_le();
17014 __struct.yawspeed = buf.get_f32_le();
17015 __struct.lat = buf.get_i32_le();
17016 __struct.lon = buf.get_i32_le();
17017 __struct.alt = buf.get_i32_le();
17018 __struct.vx = buf.get_i16_le();
17019 __struct.vy = buf.get_i16_le();
17020 __struct.vz = buf.get_i16_le();
17021 __struct.xacc = buf.get_i16_le();
17022 __struct.yacc = buf.get_i16_le();
17023 __struct.zacc = buf.get_i16_le();
17024 Ok(__struct)
17025 }
17026 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17027 let mut __tmp = BytesMut::new(bytes);
17028 #[allow(clippy::absurd_extreme_comparisons)]
17029 #[allow(unused_comparisons)]
17030 if __tmp.remaining() < Self::ENCODED_LEN {
17031 panic!(
17032 "buffer is too small (need {} bytes, but got {})",
17033 Self::ENCODED_LEN,
17034 __tmp.remaining(),
17035 )
17036 }
17037 __tmp.put_u64_le(self.time_usec);
17038 __tmp.put_f32_le(self.roll);
17039 __tmp.put_f32_le(self.pitch);
17040 __tmp.put_f32_le(self.yaw);
17041 __tmp.put_f32_le(self.rollspeed);
17042 __tmp.put_f32_le(self.pitchspeed);
17043 __tmp.put_f32_le(self.yawspeed);
17044 __tmp.put_i32_le(self.lat);
17045 __tmp.put_i32_le(self.lon);
17046 __tmp.put_i32_le(self.alt);
17047 __tmp.put_i16_le(self.vx);
17048 __tmp.put_i16_le(self.vy);
17049 __tmp.put_i16_le(self.vz);
17050 __tmp.put_i16_le(self.xacc);
17051 __tmp.put_i16_le(self.yacc);
17052 __tmp.put_i16_le(self.zacc);
17053 if matches!(version, MavlinkVersion::V2) {
17054 let len = __tmp.len();
17055 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17056 } else {
17057 __tmp.len()
17058 }
17059 }
17060}
17061#[doc = "id: 115"]
17062#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17063#[derive(Debug, Clone, PartialEq)]
17064#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17065#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17066pub struct HIL_STATE_QUATERNION_DATA {
17067 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17068 pub time_usec: u64,
17069 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
17070 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17071 pub attitude_quaternion: [f32; 4],
17072 #[doc = "Body frame roll / phi angular speed"]
17073 pub rollspeed: f32,
17074 #[doc = "Body frame pitch / theta angular speed"]
17075 pub pitchspeed: f32,
17076 #[doc = "Body frame yaw / psi angular speed"]
17077 pub yawspeed: f32,
17078 #[doc = "Latitude"]
17079 pub lat: i32,
17080 #[doc = "Longitude"]
17081 pub lon: i32,
17082 #[doc = "Altitude"]
17083 pub alt: i32,
17084 #[doc = "Ground X Speed (Latitude)"]
17085 pub vx: i16,
17086 #[doc = "Ground Y Speed (Longitude)"]
17087 pub vy: i16,
17088 #[doc = "Ground Z Speed (Altitude)"]
17089 pub vz: i16,
17090 #[doc = "Indicated airspeed"]
17091 pub ind_airspeed: u16,
17092 #[doc = "True airspeed"]
17093 pub true_airspeed: u16,
17094 #[doc = "X acceleration"]
17095 pub xacc: i16,
17096 #[doc = "Y acceleration"]
17097 pub yacc: i16,
17098 #[doc = "Z acceleration"]
17099 pub zacc: i16,
17100}
17101impl HIL_STATE_QUATERNION_DATA {
17102 pub const ENCODED_LEN: usize = 64usize;
17103 pub const DEFAULT: Self = Self {
17104 time_usec: 0_u64,
17105 attitude_quaternion: [0.0_f32; 4usize],
17106 rollspeed: 0.0_f32,
17107 pitchspeed: 0.0_f32,
17108 yawspeed: 0.0_f32,
17109 lat: 0_i32,
17110 lon: 0_i32,
17111 alt: 0_i32,
17112 vx: 0_i16,
17113 vy: 0_i16,
17114 vz: 0_i16,
17115 ind_airspeed: 0_u16,
17116 true_airspeed: 0_u16,
17117 xacc: 0_i16,
17118 yacc: 0_i16,
17119 zacc: 0_i16,
17120 };
17121 #[cfg(feature = "arbitrary")]
17122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17123 use arbitrary::{Arbitrary, Unstructured};
17124 let mut buf = [0u8; 1024];
17125 rng.fill_bytes(&mut buf);
17126 let mut unstructured = Unstructured::new(&buf);
17127 Self::arbitrary(&mut unstructured).unwrap_or_default()
17128 }
17129}
17130impl Default for HIL_STATE_QUATERNION_DATA {
17131 fn default() -> Self {
17132 Self::DEFAULT.clone()
17133 }
17134}
17135impl MessageData for HIL_STATE_QUATERNION_DATA {
17136 type Message = MavMessage;
17137 const ID: u32 = 115u32;
17138 const NAME: &'static str = "HIL_STATE_QUATERNION";
17139 const EXTRA_CRC: u8 = 4u8;
17140 const ENCODED_LEN: usize = 64usize;
17141 fn deser(
17142 _version: MavlinkVersion,
17143 __input: &[u8],
17144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17145 let avail_len = __input.len();
17146 let mut payload_buf = [0; Self::ENCODED_LEN];
17147 let mut buf = if avail_len < Self::ENCODED_LEN {
17148 payload_buf[0..avail_len].copy_from_slice(__input);
17149 Bytes::new(&payload_buf)
17150 } else {
17151 Bytes::new(__input)
17152 };
17153 let mut __struct = Self::default();
17154 __struct.time_usec = buf.get_u64_le();
17155 for v in &mut __struct.attitude_quaternion {
17156 let val = buf.get_f32_le();
17157 *v = val;
17158 }
17159 __struct.rollspeed = buf.get_f32_le();
17160 __struct.pitchspeed = buf.get_f32_le();
17161 __struct.yawspeed = buf.get_f32_le();
17162 __struct.lat = buf.get_i32_le();
17163 __struct.lon = buf.get_i32_le();
17164 __struct.alt = buf.get_i32_le();
17165 __struct.vx = buf.get_i16_le();
17166 __struct.vy = buf.get_i16_le();
17167 __struct.vz = buf.get_i16_le();
17168 __struct.ind_airspeed = buf.get_u16_le();
17169 __struct.true_airspeed = buf.get_u16_le();
17170 __struct.xacc = buf.get_i16_le();
17171 __struct.yacc = buf.get_i16_le();
17172 __struct.zacc = buf.get_i16_le();
17173 Ok(__struct)
17174 }
17175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17176 let mut __tmp = BytesMut::new(bytes);
17177 #[allow(clippy::absurd_extreme_comparisons)]
17178 #[allow(unused_comparisons)]
17179 if __tmp.remaining() < Self::ENCODED_LEN {
17180 panic!(
17181 "buffer is too small (need {} bytes, but got {})",
17182 Self::ENCODED_LEN,
17183 __tmp.remaining(),
17184 )
17185 }
17186 __tmp.put_u64_le(self.time_usec);
17187 for val in &self.attitude_quaternion {
17188 __tmp.put_f32_le(*val);
17189 }
17190 __tmp.put_f32_le(self.rollspeed);
17191 __tmp.put_f32_le(self.pitchspeed);
17192 __tmp.put_f32_le(self.yawspeed);
17193 __tmp.put_i32_le(self.lat);
17194 __tmp.put_i32_le(self.lon);
17195 __tmp.put_i32_le(self.alt);
17196 __tmp.put_i16_le(self.vx);
17197 __tmp.put_i16_le(self.vy);
17198 __tmp.put_i16_le(self.vz);
17199 __tmp.put_u16_le(self.ind_airspeed);
17200 __tmp.put_u16_le(self.true_airspeed);
17201 __tmp.put_i16_le(self.xacc);
17202 __tmp.put_i16_le(self.yacc);
17203 __tmp.put_i16_le(self.zacc);
17204 if matches!(version, MavlinkVersion::V2) {
17205 let len = __tmp.len();
17206 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17207 } else {
17208 __tmp.len()
17209 }
17210 }
17211}
17212#[doc = "id: 242"]
17213#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
17214#[derive(Debug, Clone, PartialEq)]
17215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17217pub struct HOME_POSITION_DATA {
17218 #[doc = "Latitude (WGS84)"]
17219 pub latitude: i32,
17220 #[doc = "Longitude (WGS84)"]
17221 pub longitude: i32,
17222 #[doc = "Altitude (MSL). Positive for up."]
17223 pub altitude: i32,
17224 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
17225 pub x: f32,
17226 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
17227 pub y: f32,
17228 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
17229 pub z: f32,
17230 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
17231 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17232 pub q: [f32; 4],
17233 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17234 pub approach_x: f32,
17235 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17236 pub approach_y: f32,
17237 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17238 pub approach_z: f32,
17239 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17240 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17241 pub time_usec: u64,
17242}
17243impl HOME_POSITION_DATA {
17244 pub const ENCODED_LEN: usize = 60usize;
17245 pub const DEFAULT: Self = Self {
17246 latitude: 0_i32,
17247 longitude: 0_i32,
17248 altitude: 0_i32,
17249 x: 0.0_f32,
17250 y: 0.0_f32,
17251 z: 0.0_f32,
17252 q: [0.0_f32; 4usize],
17253 approach_x: 0.0_f32,
17254 approach_y: 0.0_f32,
17255 approach_z: 0.0_f32,
17256 time_usec: 0_u64,
17257 };
17258 #[cfg(feature = "arbitrary")]
17259 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17260 use arbitrary::{Arbitrary, Unstructured};
17261 let mut buf = [0u8; 1024];
17262 rng.fill_bytes(&mut buf);
17263 let mut unstructured = Unstructured::new(&buf);
17264 Self::arbitrary(&mut unstructured).unwrap_or_default()
17265 }
17266}
17267impl Default for HOME_POSITION_DATA {
17268 fn default() -> Self {
17269 Self::DEFAULT.clone()
17270 }
17271}
17272impl MessageData for HOME_POSITION_DATA {
17273 type Message = MavMessage;
17274 const ID: u32 = 242u32;
17275 const NAME: &'static str = "HOME_POSITION";
17276 const EXTRA_CRC: u8 = 104u8;
17277 const ENCODED_LEN: usize = 60usize;
17278 fn deser(
17279 _version: MavlinkVersion,
17280 __input: &[u8],
17281 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17282 let avail_len = __input.len();
17283 let mut payload_buf = [0; Self::ENCODED_LEN];
17284 let mut buf = if avail_len < Self::ENCODED_LEN {
17285 payload_buf[0..avail_len].copy_from_slice(__input);
17286 Bytes::new(&payload_buf)
17287 } else {
17288 Bytes::new(__input)
17289 };
17290 let mut __struct = Self::default();
17291 __struct.latitude = buf.get_i32_le();
17292 __struct.longitude = buf.get_i32_le();
17293 __struct.altitude = buf.get_i32_le();
17294 __struct.x = buf.get_f32_le();
17295 __struct.y = buf.get_f32_le();
17296 __struct.z = buf.get_f32_le();
17297 for v in &mut __struct.q {
17298 let val = buf.get_f32_le();
17299 *v = val;
17300 }
17301 __struct.approach_x = buf.get_f32_le();
17302 __struct.approach_y = buf.get_f32_le();
17303 __struct.approach_z = buf.get_f32_le();
17304 __struct.time_usec = buf.get_u64_le();
17305 Ok(__struct)
17306 }
17307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17308 let mut __tmp = BytesMut::new(bytes);
17309 #[allow(clippy::absurd_extreme_comparisons)]
17310 #[allow(unused_comparisons)]
17311 if __tmp.remaining() < Self::ENCODED_LEN {
17312 panic!(
17313 "buffer is too small (need {} bytes, but got {})",
17314 Self::ENCODED_LEN,
17315 __tmp.remaining(),
17316 )
17317 }
17318 __tmp.put_i32_le(self.latitude);
17319 __tmp.put_i32_le(self.longitude);
17320 __tmp.put_i32_le(self.altitude);
17321 __tmp.put_f32_le(self.x);
17322 __tmp.put_f32_le(self.y);
17323 __tmp.put_f32_le(self.z);
17324 for val in &self.q {
17325 __tmp.put_f32_le(*val);
17326 }
17327 __tmp.put_f32_le(self.approach_x);
17328 __tmp.put_f32_le(self.approach_y);
17329 __tmp.put_f32_le(self.approach_z);
17330 __tmp.put_u64_le(self.time_usec);
17331 if matches!(version, MavlinkVersion::V2) {
17332 let len = __tmp.len();
17333 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17334 } else {
17335 __tmp.len()
17336 }
17337 }
17338}
17339#[doc = "id: 12920"]
17340#[doc = "Temperature and humidity from hygrometer."]
17341#[derive(Debug, Clone, PartialEq)]
17342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17344pub struct HYGROMETER_SENSOR_DATA {
17345 #[doc = "Temperature"]
17346 pub temperature: i16,
17347 #[doc = "Humidity"]
17348 pub humidity: u16,
17349 #[doc = "Hygrometer ID"]
17350 pub id: u8,
17351}
17352impl HYGROMETER_SENSOR_DATA {
17353 pub const ENCODED_LEN: usize = 5usize;
17354 pub const DEFAULT: Self = Self {
17355 temperature: 0_i16,
17356 humidity: 0_u16,
17357 id: 0_u8,
17358 };
17359 #[cfg(feature = "arbitrary")]
17360 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17361 use arbitrary::{Arbitrary, Unstructured};
17362 let mut buf = [0u8; 1024];
17363 rng.fill_bytes(&mut buf);
17364 let mut unstructured = Unstructured::new(&buf);
17365 Self::arbitrary(&mut unstructured).unwrap_or_default()
17366 }
17367}
17368impl Default for HYGROMETER_SENSOR_DATA {
17369 fn default() -> Self {
17370 Self::DEFAULT.clone()
17371 }
17372}
17373impl MessageData for HYGROMETER_SENSOR_DATA {
17374 type Message = MavMessage;
17375 const ID: u32 = 12920u32;
17376 const NAME: &'static str = "HYGROMETER_SENSOR";
17377 const EXTRA_CRC: u8 = 20u8;
17378 const ENCODED_LEN: usize = 5usize;
17379 fn deser(
17380 _version: MavlinkVersion,
17381 __input: &[u8],
17382 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17383 let avail_len = __input.len();
17384 let mut payload_buf = [0; Self::ENCODED_LEN];
17385 let mut buf = if avail_len < Self::ENCODED_LEN {
17386 payload_buf[0..avail_len].copy_from_slice(__input);
17387 Bytes::new(&payload_buf)
17388 } else {
17389 Bytes::new(__input)
17390 };
17391 let mut __struct = Self::default();
17392 __struct.temperature = buf.get_i16_le();
17393 __struct.humidity = buf.get_u16_le();
17394 __struct.id = buf.get_u8();
17395 Ok(__struct)
17396 }
17397 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17398 let mut __tmp = BytesMut::new(bytes);
17399 #[allow(clippy::absurd_extreme_comparisons)]
17400 #[allow(unused_comparisons)]
17401 if __tmp.remaining() < Self::ENCODED_LEN {
17402 panic!(
17403 "buffer is too small (need {} bytes, but got {})",
17404 Self::ENCODED_LEN,
17405 __tmp.remaining(),
17406 )
17407 }
17408 __tmp.put_i16_le(self.temperature);
17409 __tmp.put_u16_le(self.humidity);
17410 __tmp.put_u8(self.id);
17411 if matches!(version, MavlinkVersion::V2) {
17412 let len = __tmp.len();
17413 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17414 } else {
17415 __tmp.len()
17416 }
17417 }
17418}
17419#[doc = "id: 440"]
17420#[doc = "Illuminator status."]
17421#[derive(Debug, Clone, PartialEq)]
17422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17424pub struct ILLUMINATOR_STATUS_DATA {
17425 #[doc = "Time since the start-up of the illuminator in ms"]
17426 pub uptime_ms: u32,
17427 #[doc = "Errors"]
17428 pub error_status: IlluminatorErrorFlags,
17429 #[doc = "Illuminator brightness"]
17430 pub brightness: f32,
17431 #[doc = "Illuminator strobing period in seconds"]
17432 pub strobe_period: f32,
17433 #[doc = "Illuminator strobing duty cycle"]
17434 pub strobe_duty_cycle: f32,
17435 #[doc = "Temperature in Celsius"]
17436 pub temp_c: f32,
17437 #[doc = "Minimum strobing period in seconds"]
17438 pub min_strobe_period: f32,
17439 #[doc = "Maximum strobing period in seconds"]
17440 pub max_strobe_period: f32,
17441 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17442 pub enable: u8,
17443 #[doc = "Supported illuminator modes"]
17444 pub mode_bitmask: IlluminatorMode,
17445 #[doc = "Illuminator mode"]
17446 pub mode: IlluminatorMode,
17447}
17448impl ILLUMINATOR_STATUS_DATA {
17449 pub const ENCODED_LEN: usize = 35usize;
17450 pub const DEFAULT: Self = Self {
17451 uptime_ms: 0_u32,
17452 error_status: IlluminatorErrorFlags::DEFAULT,
17453 brightness: 0.0_f32,
17454 strobe_period: 0.0_f32,
17455 strobe_duty_cycle: 0.0_f32,
17456 temp_c: 0.0_f32,
17457 min_strobe_period: 0.0_f32,
17458 max_strobe_period: 0.0_f32,
17459 enable: 0_u8,
17460 mode_bitmask: IlluminatorMode::DEFAULT,
17461 mode: IlluminatorMode::DEFAULT,
17462 };
17463 #[cfg(feature = "arbitrary")]
17464 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17465 use arbitrary::{Arbitrary, Unstructured};
17466 let mut buf = [0u8; 1024];
17467 rng.fill_bytes(&mut buf);
17468 let mut unstructured = Unstructured::new(&buf);
17469 Self::arbitrary(&mut unstructured).unwrap_or_default()
17470 }
17471}
17472impl Default for ILLUMINATOR_STATUS_DATA {
17473 fn default() -> Self {
17474 Self::DEFAULT.clone()
17475 }
17476}
17477impl MessageData for ILLUMINATOR_STATUS_DATA {
17478 type Message = MavMessage;
17479 const ID: u32 = 440u32;
17480 const NAME: &'static str = "ILLUMINATOR_STATUS";
17481 const EXTRA_CRC: u8 = 66u8;
17482 const ENCODED_LEN: usize = 35usize;
17483 fn deser(
17484 _version: MavlinkVersion,
17485 __input: &[u8],
17486 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17487 let avail_len = __input.len();
17488 let mut payload_buf = [0; Self::ENCODED_LEN];
17489 let mut buf = if avail_len < Self::ENCODED_LEN {
17490 payload_buf[0..avail_len].copy_from_slice(__input);
17491 Bytes::new(&payload_buf)
17492 } else {
17493 Bytes::new(__input)
17494 };
17495 let mut __struct = Self::default();
17496 __struct.uptime_ms = buf.get_u32_le();
17497 let tmp = buf.get_u32_le();
17498 __struct.error_status = IlluminatorErrorFlags::from_bits(
17499 tmp & IlluminatorErrorFlags::all().bits(),
17500 )
17501 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17502 flag_type: "IlluminatorErrorFlags",
17503 value: tmp as u32,
17504 })?;
17505 __struct.brightness = buf.get_f32_le();
17506 __struct.strobe_period = buf.get_f32_le();
17507 __struct.strobe_duty_cycle = buf.get_f32_le();
17508 __struct.temp_c = buf.get_f32_le();
17509 __struct.min_strobe_period = buf.get_f32_le();
17510 __struct.max_strobe_period = buf.get_f32_le();
17511 __struct.enable = buf.get_u8();
17512 let tmp = buf.get_u8();
17513 __struct.mode_bitmask =
17514 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17515 enum_type: "IlluminatorMode",
17516 value: tmp as u32,
17517 })?;
17518 let tmp = buf.get_u8();
17519 __struct.mode =
17520 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17521 enum_type: "IlluminatorMode",
17522 value: tmp as u32,
17523 })?;
17524 Ok(__struct)
17525 }
17526 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17527 let mut __tmp = BytesMut::new(bytes);
17528 #[allow(clippy::absurd_extreme_comparisons)]
17529 #[allow(unused_comparisons)]
17530 if __tmp.remaining() < Self::ENCODED_LEN {
17531 panic!(
17532 "buffer is too small (need {} bytes, but got {})",
17533 Self::ENCODED_LEN,
17534 __tmp.remaining(),
17535 )
17536 }
17537 __tmp.put_u32_le(self.uptime_ms);
17538 __tmp.put_u32_le(self.error_status.bits());
17539 __tmp.put_f32_le(self.brightness);
17540 __tmp.put_f32_le(self.strobe_period);
17541 __tmp.put_f32_le(self.strobe_duty_cycle);
17542 __tmp.put_f32_le(self.temp_c);
17543 __tmp.put_f32_le(self.min_strobe_period);
17544 __tmp.put_f32_le(self.max_strobe_period);
17545 __tmp.put_u8(self.enable);
17546 __tmp.put_u8(self.mode_bitmask as u8);
17547 __tmp.put_u8(self.mode as u8);
17548 if matches!(version, MavlinkVersion::V2) {
17549 let len = __tmp.len();
17550 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17551 } else {
17552 __tmp.len()
17553 }
17554 }
17555}
17556#[doc = "id: 335"]
17557#[doc = "Status of the Iridium SBD link."]
17558#[derive(Debug, Clone, PartialEq)]
17559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17561pub struct ISBD_LINK_STATUS_DATA {
17562 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17563 pub timestamp: u64,
17564 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17565 pub last_heartbeat: u64,
17566 #[doc = "Number of failed SBD sessions."]
17567 pub failed_sessions: u16,
17568 #[doc = "Number of successful SBD sessions."]
17569 pub successful_sessions: u16,
17570 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17571 pub signal_quality: u8,
17572 #[doc = "1: Ring call pending, 0: No call pending."]
17573 pub ring_pending: u8,
17574 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17575 pub tx_session_pending: u8,
17576 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17577 pub rx_session_pending: u8,
17578}
17579impl ISBD_LINK_STATUS_DATA {
17580 pub const ENCODED_LEN: usize = 24usize;
17581 pub const DEFAULT: Self = Self {
17582 timestamp: 0_u64,
17583 last_heartbeat: 0_u64,
17584 failed_sessions: 0_u16,
17585 successful_sessions: 0_u16,
17586 signal_quality: 0_u8,
17587 ring_pending: 0_u8,
17588 tx_session_pending: 0_u8,
17589 rx_session_pending: 0_u8,
17590 };
17591 #[cfg(feature = "arbitrary")]
17592 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17593 use arbitrary::{Arbitrary, Unstructured};
17594 let mut buf = [0u8; 1024];
17595 rng.fill_bytes(&mut buf);
17596 let mut unstructured = Unstructured::new(&buf);
17597 Self::arbitrary(&mut unstructured).unwrap_or_default()
17598 }
17599}
17600impl Default for ISBD_LINK_STATUS_DATA {
17601 fn default() -> Self {
17602 Self::DEFAULT.clone()
17603 }
17604}
17605impl MessageData for ISBD_LINK_STATUS_DATA {
17606 type Message = MavMessage;
17607 const ID: u32 = 335u32;
17608 const NAME: &'static str = "ISBD_LINK_STATUS";
17609 const EXTRA_CRC: u8 = 225u8;
17610 const ENCODED_LEN: usize = 24usize;
17611 fn deser(
17612 _version: MavlinkVersion,
17613 __input: &[u8],
17614 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17615 let avail_len = __input.len();
17616 let mut payload_buf = [0; Self::ENCODED_LEN];
17617 let mut buf = if avail_len < Self::ENCODED_LEN {
17618 payload_buf[0..avail_len].copy_from_slice(__input);
17619 Bytes::new(&payload_buf)
17620 } else {
17621 Bytes::new(__input)
17622 };
17623 let mut __struct = Self::default();
17624 __struct.timestamp = buf.get_u64_le();
17625 __struct.last_heartbeat = buf.get_u64_le();
17626 __struct.failed_sessions = buf.get_u16_le();
17627 __struct.successful_sessions = buf.get_u16_le();
17628 __struct.signal_quality = buf.get_u8();
17629 __struct.ring_pending = buf.get_u8();
17630 __struct.tx_session_pending = buf.get_u8();
17631 __struct.rx_session_pending = buf.get_u8();
17632 Ok(__struct)
17633 }
17634 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17635 let mut __tmp = BytesMut::new(bytes);
17636 #[allow(clippy::absurd_extreme_comparisons)]
17637 #[allow(unused_comparisons)]
17638 if __tmp.remaining() < Self::ENCODED_LEN {
17639 panic!(
17640 "buffer is too small (need {} bytes, but got {})",
17641 Self::ENCODED_LEN,
17642 __tmp.remaining(),
17643 )
17644 }
17645 __tmp.put_u64_le(self.timestamp);
17646 __tmp.put_u64_le(self.last_heartbeat);
17647 __tmp.put_u16_le(self.failed_sessions);
17648 __tmp.put_u16_le(self.successful_sessions);
17649 __tmp.put_u8(self.signal_quality);
17650 __tmp.put_u8(self.ring_pending);
17651 __tmp.put_u8(self.tx_session_pending);
17652 __tmp.put_u8(self.rx_session_pending);
17653 if matches!(version, MavlinkVersion::V2) {
17654 let len = __tmp.len();
17655 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17656 } else {
17657 __tmp.len()
17658 }
17659 }
17660}
17661#[doc = "id: 149"]
17662#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17663#[derive(Debug, Clone, PartialEq)]
17664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17666pub struct LANDING_TARGET_DATA {
17667 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17668 pub time_usec: u64,
17669 #[doc = "X-axis angular offset of the target from the center of the image"]
17670 pub angle_x: f32,
17671 #[doc = "Y-axis angular offset of the target from the center of the image"]
17672 pub angle_y: f32,
17673 #[doc = "Distance to the target from the vehicle"]
17674 pub distance: f32,
17675 #[doc = "Size of target along x-axis"]
17676 pub size_x: f32,
17677 #[doc = "Size of target along y-axis"]
17678 pub size_y: f32,
17679 #[doc = "The ID of the target if multiple targets are present"]
17680 pub target_num: u8,
17681 #[doc = "Coordinate frame used for following fields."]
17682 pub frame: MavFrame,
17683 #[doc = "X Position of the landing target in MAV_FRAME"]
17684 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17685 pub x: f32,
17686 #[doc = "Y Position of the landing target in MAV_FRAME"]
17687 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17688 pub y: f32,
17689 #[doc = "Z Position of the landing target in MAV_FRAME"]
17690 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17691 pub z: f32,
17692 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17693 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17694 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17695 pub q: [f32; 4],
17696 #[doc = "Type of landing target"]
17697 #[cfg_attr(feature = "serde", serde(default))]
17698 pub mavtype: LandingTargetType,
17699 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17700 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17701 pub position_valid: u8,
17702}
17703impl LANDING_TARGET_DATA {
17704 pub const ENCODED_LEN: usize = 60usize;
17705 pub const DEFAULT: Self = Self {
17706 time_usec: 0_u64,
17707 angle_x: 0.0_f32,
17708 angle_y: 0.0_f32,
17709 distance: 0.0_f32,
17710 size_x: 0.0_f32,
17711 size_y: 0.0_f32,
17712 target_num: 0_u8,
17713 frame: MavFrame::DEFAULT,
17714 x: 0.0_f32,
17715 y: 0.0_f32,
17716 z: 0.0_f32,
17717 q: [0.0_f32; 4usize],
17718 mavtype: LandingTargetType::DEFAULT,
17719 position_valid: 0_u8,
17720 };
17721 #[cfg(feature = "arbitrary")]
17722 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17723 use arbitrary::{Arbitrary, Unstructured};
17724 let mut buf = [0u8; 1024];
17725 rng.fill_bytes(&mut buf);
17726 let mut unstructured = Unstructured::new(&buf);
17727 Self::arbitrary(&mut unstructured).unwrap_or_default()
17728 }
17729}
17730impl Default for LANDING_TARGET_DATA {
17731 fn default() -> Self {
17732 Self::DEFAULT.clone()
17733 }
17734}
17735impl MessageData for LANDING_TARGET_DATA {
17736 type Message = MavMessage;
17737 const ID: u32 = 149u32;
17738 const NAME: &'static str = "LANDING_TARGET";
17739 const EXTRA_CRC: u8 = 200u8;
17740 const ENCODED_LEN: usize = 60usize;
17741 fn deser(
17742 _version: MavlinkVersion,
17743 __input: &[u8],
17744 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17745 let avail_len = __input.len();
17746 let mut payload_buf = [0; Self::ENCODED_LEN];
17747 let mut buf = if avail_len < Self::ENCODED_LEN {
17748 payload_buf[0..avail_len].copy_from_slice(__input);
17749 Bytes::new(&payload_buf)
17750 } else {
17751 Bytes::new(__input)
17752 };
17753 let mut __struct = Self::default();
17754 __struct.time_usec = buf.get_u64_le();
17755 __struct.angle_x = buf.get_f32_le();
17756 __struct.angle_y = buf.get_f32_le();
17757 __struct.distance = buf.get_f32_le();
17758 __struct.size_x = buf.get_f32_le();
17759 __struct.size_y = buf.get_f32_le();
17760 __struct.target_num = buf.get_u8();
17761 let tmp = buf.get_u8();
17762 __struct.frame =
17763 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17764 enum_type: "MavFrame",
17765 value: tmp as u32,
17766 })?;
17767 __struct.x = buf.get_f32_le();
17768 __struct.y = buf.get_f32_le();
17769 __struct.z = buf.get_f32_le();
17770 for v in &mut __struct.q {
17771 let val = buf.get_f32_le();
17772 *v = val;
17773 }
17774 let tmp = buf.get_u8();
17775 __struct.mavtype =
17776 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17777 enum_type: "LandingTargetType",
17778 value: tmp as u32,
17779 })?;
17780 __struct.position_valid = buf.get_u8();
17781 Ok(__struct)
17782 }
17783 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17784 let mut __tmp = BytesMut::new(bytes);
17785 #[allow(clippy::absurd_extreme_comparisons)]
17786 #[allow(unused_comparisons)]
17787 if __tmp.remaining() < Self::ENCODED_LEN {
17788 panic!(
17789 "buffer is too small (need {} bytes, but got {})",
17790 Self::ENCODED_LEN,
17791 __tmp.remaining(),
17792 )
17793 }
17794 __tmp.put_u64_le(self.time_usec);
17795 __tmp.put_f32_le(self.angle_x);
17796 __tmp.put_f32_le(self.angle_y);
17797 __tmp.put_f32_le(self.distance);
17798 __tmp.put_f32_le(self.size_x);
17799 __tmp.put_f32_le(self.size_y);
17800 __tmp.put_u8(self.target_num);
17801 __tmp.put_u8(self.frame as u8);
17802 __tmp.put_f32_le(self.x);
17803 __tmp.put_f32_le(self.y);
17804 __tmp.put_f32_le(self.z);
17805 for val in &self.q {
17806 __tmp.put_f32_le(*val);
17807 }
17808 __tmp.put_u8(self.mavtype as u8);
17809 __tmp.put_u8(self.position_valid);
17810 if matches!(version, MavlinkVersion::V2) {
17811 let len = __tmp.len();
17812 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17813 } else {
17814 __tmp.len()
17815 }
17816 }
17817}
17818#[doc = "id: 8"]
17819#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17820#[derive(Debug, Clone, PartialEq)]
17821#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17823pub struct LINK_NODE_STATUS_DATA {
17824 #[doc = "Timestamp (time since system boot)."]
17825 pub timestamp: u64,
17826 #[doc = "Transmit rate"]
17827 pub tx_rate: u32,
17828 #[doc = "Receive rate"]
17829 pub rx_rate: u32,
17830 #[doc = "Messages sent"]
17831 pub messages_sent: u32,
17832 #[doc = "Messages received (estimated from counting seq)"]
17833 pub messages_received: u32,
17834 #[doc = "Messages lost (estimated from counting seq)"]
17835 pub messages_lost: u32,
17836 #[doc = "Number of bytes that could not be parsed correctly."]
17837 pub rx_parse_err: u16,
17838 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17839 pub tx_overflows: u16,
17840 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17841 pub rx_overflows: u16,
17842 #[doc = "Remaining free transmit buffer space"]
17843 pub tx_buf: u8,
17844 #[doc = "Remaining free receive buffer space"]
17845 pub rx_buf: u8,
17846}
17847impl LINK_NODE_STATUS_DATA {
17848 pub const ENCODED_LEN: usize = 36usize;
17849 pub const DEFAULT: Self = Self {
17850 timestamp: 0_u64,
17851 tx_rate: 0_u32,
17852 rx_rate: 0_u32,
17853 messages_sent: 0_u32,
17854 messages_received: 0_u32,
17855 messages_lost: 0_u32,
17856 rx_parse_err: 0_u16,
17857 tx_overflows: 0_u16,
17858 rx_overflows: 0_u16,
17859 tx_buf: 0_u8,
17860 rx_buf: 0_u8,
17861 };
17862 #[cfg(feature = "arbitrary")]
17863 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17864 use arbitrary::{Arbitrary, Unstructured};
17865 let mut buf = [0u8; 1024];
17866 rng.fill_bytes(&mut buf);
17867 let mut unstructured = Unstructured::new(&buf);
17868 Self::arbitrary(&mut unstructured).unwrap_or_default()
17869 }
17870}
17871impl Default for LINK_NODE_STATUS_DATA {
17872 fn default() -> Self {
17873 Self::DEFAULT.clone()
17874 }
17875}
17876impl MessageData for LINK_NODE_STATUS_DATA {
17877 type Message = MavMessage;
17878 const ID: u32 = 8u32;
17879 const NAME: &'static str = "LINK_NODE_STATUS";
17880 const EXTRA_CRC: u8 = 117u8;
17881 const ENCODED_LEN: usize = 36usize;
17882 fn deser(
17883 _version: MavlinkVersion,
17884 __input: &[u8],
17885 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17886 let avail_len = __input.len();
17887 let mut payload_buf = [0; Self::ENCODED_LEN];
17888 let mut buf = if avail_len < Self::ENCODED_LEN {
17889 payload_buf[0..avail_len].copy_from_slice(__input);
17890 Bytes::new(&payload_buf)
17891 } else {
17892 Bytes::new(__input)
17893 };
17894 let mut __struct = Self::default();
17895 __struct.timestamp = buf.get_u64_le();
17896 __struct.tx_rate = buf.get_u32_le();
17897 __struct.rx_rate = buf.get_u32_le();
17898 __struct.messages_sent = buf.get_u32_le();
17899 __struct.messages_received = buf.get_u32_le();
17900 __struct.messages_lost = buf.get_u32_le();
17901 __struct.rx_parse_err = buf.get_u16_le();
17902 __struct.tx_overflows = buf.get_u16_le();
17903 __struct.rx_overflows = buf.get_u16_le();
17904 __struct.tx_buf = buf.get_u8();
17905 __struct.rx_buf = buf.get_u8();
17906 Ok(__struct)
17907 }
17908 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17909 let mut __tmp = BytesMut::new(bytes);
17910 #[allow(clippy::absurd_extreme_comparisons)]
17911 #[allow(unused_comparisons)]
17912 if __tmp.remaining() < Self::ENCODED_LEN {
17913 panic!(
17914 "buffer is too small (need {} bytes, but got {})",
17915 Self::ENCODED_LEN,
17916 __tmp.remaining(),
17917 )
17918 }
17919 __tmp.put_u64_le(self.timestamp);
17920 __tmp.put_u32_le(self.tx_rate);
17921 __tmp.put_u32_le(self.rx_rate);
17922 __tmp.put_u32_le(self.messages_sent);
17923 __tmp.put_u32_le(self.messages_received);
17924 __tmp.put_u32_le(self.messages_lost);
17925 __tmp.put_u16_le(self.rx_parse_err);
17926 __tmp.put_u16_le(self.tx_overflows);
17927 __tmp.put_u16_le(self.rx_overflows);
17928 __tmp.put_u8(self.tx_buf);
17929 __tmp.put_u8(self.rx_buf);
17930 if matches!(version, MavlinkVersion::V2) {
17931 let len = __tmp.len();
17932 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17933 } else {
17934 __tmp.len()
17935 }
17936 }
17937}
17938#[doc = "id: 32"]
17939#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17940#[derive(Debug, Clone, PartialEq)]
17941#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17942#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17943pub struct LOCAL_POSITION_NED_DATA {
17944 #[doc = "Timestamp (time since system boot)."]
17945 pub time_boot_ms: u32,
17946 #[doc = "X Position"]
17947 pub x: f32,
17948 #[doc = "Y Position"]
17949 pub y: f32,
17950 #[doc = "Z Position"]
17951 pub z: f32,
17952 #[doc = "X Speed"]
17953 pub vx: f32,
17954 #[doc = "Y Speed"]
17955 pub vy: f32,
17956 #[doc = "Z Speed"]
17957 pub vz: f32,
17958}
17959impl LOCAL_POSITION_NED_DATA {
17960 pub const ENCODED_LEN: usize = 28usize;
17961 pub const DEFAULT: Self = Self {
17962 time_boot_ms: 0_u32,
17963 x: 0.0_f32,
17964 y: 0.0_f32,
17965 z: 0.0_f32,
17966 vx: 0.0_f32,
17967 vy: 0.0_f32,
17968 vz: 0.0_f32,
17969 };
17970 #[cfg(feature = "arbitrary")]
17971 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17972 use arbitrary::{Arbitrary, Unstructured};
17973 let mut buf = [0u8; 1024];
17974 rng.fill_bytes(&mut buf);
17975 let mut unstructured = Unstructured::new(&buf);
17976 Self::arbitrary(&mut unstructured).unwrap_or_default()
17977 }
17978}
17979impl Default for LOCAL_POSITION_NED_DATA {
17980 fn default() -> Self {
17981 Self::DEFAULT.clone()
17982 }
17983}
17984impl MessageData for LOCAL_POSITION_NED_DATA {
17985 type Message = MavMessage;
17986 const ID: u32 = 32u32;
17987 const NAME: &'static str = "LOCAL_POSITION_NED";
17988 const EXTRA_CRC: u8 = 185u8;
17989 const ENCODED_LEN: usize = 28usize;
17990 fn deser(
17991 _version: MavlinkVersion,
17992 __input: &[u8],
17993 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17994 let avail_len = __input.len();
17995 let mut payload_buf = [0; Self::ENCODED_LEN];
17996 let mut buf = if avail_len < Self::ENCODED_LEN {
17997 payload_buf[0..avail_len].copy_from_slice(__input);
17998 Bytes::new(&payload_buf)
17999 } else {
18000 Bytes::new(__input)
18001 };
18002 let mut __struct = Self::default();
18003 __struct.time_boot_ms = buf.get_u32_le();
18004 __struct.x = buf.get_f32_le();
18005 __struct.y = buf.get_f32_le();
18006 __struct.z = buf.get_f32_le();
18007 __struct.vx = buf.get_f32_le();
18008 __struct.vy = buf.get_f32_le();
18009 __struct.vz = buf.get_f32_le();
18010 Ok(__struct)
18011 }
18012 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18013 let mut __tmp = BytesMut::new(bytes);
18014 #[allow(clippy::absurd_extreme_comparisons)]
18015 #[allow(unused_comparisons)]
18016 if __tmp.remaining() < Self::ENCODED_LEN {
18017 panic!(
18018 "buffer is too small (need {} bytes, but got {})",
18019 Self::ENCODED_LEN,
18020 __tmp.remaining(),
18021 )
18022 }
18023 __tmp.put_u32_le(self.time_boot_ms);
18024 __tmp.put_f32_le(self.x);
18025 __tmp.put_f32_le(self.y);
18026 __tmp.put_f32_le(self.z);
18027 __tmp.put_f32_le(self.vx);
18028 __tmp.put_f32_le(self.vy);
18029 __tmp.put_f32_le(self.vz);
18030 if matches!(version, MavlinkVersion::V2) {
18031 let len = __tmp.len();
18032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18033 } else {
18034 __tmp.len()
18035 }
18036 }
18037}
18038#[doc = "id: 64"]
18039#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18040#[derive(Debug, Clone, PartialEq)]
18041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18043pub struct LOCAL_POSITION_NED_COV_DATA {
18044 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18045 pub time_usec: u64,
18046 #[doc = "X Position"]
18047 pub x: f32,
18048 #[doc = "Y Position"]
18049 pub y: f32,
18050 #[doc = "Z Position"]
18051 pub z: f32,
18052 #[doc = "X Speed"]
18053 pub vx: f32,
18054 #[doc = "Y Speed"]
18055 pub vy: f32,
18056 #[doc = "Z Speed"]
18057 pub vz: f32,
18058 #[doc = "X Acceleration"]
18059 pub ax: f32,
18060 #[doc = "Y Acceleration"]
18061 pub ay: f32,
18062 #[doc = "Z Acceleration"]
18063 pub az: f32,
18064 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
18065 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18066 pub covariance: [f32; 45],
18067 #[doc = "Class id of the estimator this estimate originated from."]
18068 pub estimator_type: MavEstimatorType,
18069}
18070impl LOCAL_POSITION_NED_COV_DATA {
18071 pub const ENCODED_LEN: usize = 225usize;
18072 pub const DEFAULT: Self = Self {
18073 time_usec: 0_u64,
18074 x: 0.0_f32,
18075 y: 0.0_f32,
18076 z: 0.0_f32,
18077 vx: 0.0_f32,
18078 vy: 0.0_f32,
18079 vz: 0.0_f32,
18080 ax: 0.0_f32,
18081 ay: 0.0_f32,
18082 az: 0.0_f32,
18083 covariance: [0.0_f32; 45usize],
18084 estimator_type: MavEstimatorType::DEFAULT,
18085 };
18086 #[cfg(feature = "arbitrary")]
18087 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18088 use arbitrary::{Arbitrary, Unstructured};
18089 let mut buf = [0u8; 1024];
18090 rng.fill_bytes(&mut buf);
18091 let mut unstructured = Unstructured::new(&buf);
18092 Self::arbitrary(&mut unstructured).unwrap_or_default()
18093 }
18094}
18095impl Default for LOCAL_POSITION_NED_COV_DATA {
18096 fn default() -> Self {
18097 Self::DEFAULT.clone()
18098 }
18099}
18100impl MessageData for LOCAL_POSITION_NED_COV_DATA {
18101 type Message = MavMessage;
18102 const ID: u32 = 64u32;
18103 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
18104 const EXTRA_CRC: u8 = 191u8;
18105 const ENCODED_LEN: usize = 225usize;
18106 fn deser(
18107 _version: MavlinkVersion,
18108 __input: &[u8],
18109 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18110 let avail_len = __input.len();
18111 let mut payload_buf = [0; Self::ENCODED_LEN];
18112 let mut buf = if avail_len < Self::ENCODED_LEN {
18113 payload_buf[0..avail_len].copy_from_slice(__input);
18114 Bytes::new(&payload_buf)
18115 } else {
18116 Bytes::new(__input)
18117 };
18118 let mut __struct = Self::default();
18119 __struct.time_usec = buf.get_u64_le();
18120 __struct.x = buf.get_f32_le();
18121 __struct.y = buf.get_f32_le();
18122 __struct.z = buf.get_f32_le();
18123 __struct.vx = buf.get_f32_le();
18124 __struct.vy = buf.get_f32_le();
18125 __struct.vz = buf.get_f32_le();
18126 __struct.ax = buf.get_f32_le();
18127 __struct.ay = buf.get_f32_le();
18128 __struct.az = buf.get_f32_le();
18129 for v in &mut __struct.covariance {
18130 let val = buf.get_f32_le();
18131 *v = val;
18132 }
18133 let tmp = buf.get_u8();
18134 __struct.estimator_type =
18135 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18136 enum_type: "MavEstimatorType",
18137 value: tmp as u32,
18138 })?;
18139 Ok(__struct)
18140 }
18141 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18142 let mut __tmp = BytesMut::new(bytes);
18143 #[allow(clippy::absurd_extreme_comparisons)]
18144 #[allow(unused_comparisons)]
18145 if __tmp.remaining() < Self::ENCODED_LEN {
18146 panic!(
18147 "buffer is too small (need {} bytes, but got {})",
18148 Self::ENCODED_LEN,
18149 __tmp.remaining(),
18150 )
18151 }
18152 __tmp.put_u64_le(self.time_usec);
18153 __tmp.put_f32_le(self.x);
18154 __tmp.put_f32_le(self.y);
18155 __tmp.put_f32_le(self.z);
18156 __tmp.put_f32_le(self.vx);
18157 __tmp.put_f32_le(self.vy);
18158 __tmp.put_f32_le(self.vz);
18159 __tmp.put_f32_le(self.ax);
18160 __tmp.put_f32_le(self.ay);
18161 __tmp.put_f32_le(self.az);
18162 for val in &self.covariance {
18163 __tmp.put_f32_le(*val);
18164 }
18165 __tmp.put_u8(self.estimator_type as u8);
18166 if matches!(version, MavlinkVersion::V2) {
18167 let len = __tmp.len();
18168 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18169 } else {
18170 __tmp.len()
18171 }
18172 }
18173}
18174#[doc = "id: 89"]
18175#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18176#[derive(Debug, Clone, PartialEq)]
18177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18179pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18180 #[doc = "Timestamp (time since system boot)."]
18181 pub time_boot_ms: u32,
18182 #[doc = "X Position"]
18183 pub x: f32,
18184 #[doc = "Y Position"]
18185 pub y: f32,
18186 #[doc = "Z Position"]
18187 pub z: f32,
18188 #[doc = "Roll"]
18189 pub roll: f32,
18190 #[doc = "Pitch"]
18191 pub pitch: f32,
18192 #[doc = "Yaw"]
18193 pub yaw: f32,
18194}
18195impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18196 pub const ENCODED_LEN: usize = 28usize;
18197 pub const DEFAULT: Self = Self {
18198 time_boot_ms: 0_u32,
18199 x: 0.0_f32,
18200 y: 0.0_f32,
18201 z: 0.0_f32,
18202 roll: 0.0_f32,
18203 pitch: 0.0_f32,
18204 yaw: 0.0_f32,
18205 };
18206 #[cfg(feature = "arbitrary")]
18207 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18208 use arbitrary::{Arbitrary, Unstructured};
18209 let mut buf = [0u8; 1024];
18210 rng.fill_bytes(&mut buf);
18211 let mut unstructured = Unstructured::new(&buf);
18212 Self::arbitrary(&mut unstructured).unwrap_or_default()
18213 }
18214}
18215impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18216 fn default() -> Self {
18217 Self::DEFAULT.clone()
18218 }
18219}
18220impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18221 type Message = MavMessage;
18222 const ID: u32 = 89u32;
18223 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
18224 const EXTRA_CRC: u8 = 231u8;
18225 const ENCODED_LEN: usize = 28usize;
18226 fn deser(
18227 _version: MavlinkVersion,
18228 __input: &[u8],
18229 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18230 let avail_len = __input.len();
18231 let mut payload_buf = [0; Self::ENCODED_LEN];
18232 let mut buf = if avail_len < Self::ENCODED_LEN {
18233 payload_buf[0..avail_len].copy_from_slice(__input);
18234 Bytes::new(&payload_buf)
18235 } else {
18236 Bytes::new(__input)
18237 };
18238 let mut __struct = Self::default();
18239 __struct.time_boot_ms = buf.get_u32_le();
18240 __struct.x = buf.get_f32_le();
18241 __struct.y = buf.get_f32_le();
18242 __struct.z = buf.get_f32_le();
18243 __struct.roll = buf.get_f32_le();
18244 __struct.pitch = buf.get_f32_le();
18245 __struct.yaw = buf.get_f32_le();
18246 Ok(__struct)
18247 }
18248 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18249 let mut __tmp = BytesMut::new(bytes);
18250 #[allow(clippy::absurd_extreme_comparisons)]
18251 #[allow(unused_comparisons)]
18252 if __tmp.remaining() < Self::ENCODED_LEN {
18253 panic!(
18254 "buffer is too small (need {} bytes, but got {})",
18255 Self::ENCODED_LEN,
18256 __tmp.remaining(),
18257 )
18258 }
18259 __tmp.put_u32_le(self.time_boot_ms);
18260 __tmp.put_f32_le(self.x);
18261 __tmp.put_f32_le(self.y);
18262 __tmp.put_f32_le(self.z);
18263 __tmp.put_f32_le(self.roll);
18264 __tmp.put_f32_le(self.pitch);
18265 __tmp.put_f32_le(self.yaw);
18266 if matches!(version, MavlinkVersion::V2) {
18267 let len = __tmp.len();
18268 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18269 } else {
18270 __tmp.len()
18271 }
18272 }
18273}
18274#[doc = "id: 268"]
18275#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18276#[derive(Debug, Clone, PartialEq)]
18277#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18278#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18279pub struct LOGGING_ACK_DATA {
18280 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18281 pub sequence: u16,
18282 #[doc = "system ID of the target"]
18283 pub target_system: u8,
18284 #[doc = "component ID of the target"]
18285 pub target_component: u8,
18286}
18287impl LOGGING_ACK_DATA {
18288 pub const ENCODED_LEN: usize = 4usize;
18289 pub const DEFAULT: Self = Self {
18290 sequence: 0_u16,
18291 target_system: 0_u8,
18292 target_component: 0_u8,
18293 };
18294 #[cfg(feature = "arbitrary")]
18295 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18296 use arbitrary::{Arbitrary, Unstructured};
18297 let mut buf = [0u8; 1024];
18298 rng.fill_bytes(&mut buf);
18299 let mut unstructured = Unstructured::new(&buf);
18300 Self::arbitrary(&mut unstructured).unwrap_or_default()
18301 }
18302}
18303impl Default for LOGGING_ACK_DATA {
18304 fn default() -> Self {
18305 Self::DEFAULT.clone()
18306 }
18307}
18308impl MessageData for LOGGING_ACK_DATA {
18309 type Message = MavMessage;
18310 const ID: u32 = 268u32;
18311 const NAME: &'static str = "LOGGING_ACK";
18312 const EXTRA_CRC: u8 = 14u8;
18313 const ENCODED_LEN: usize = 4usize;
18314 fn deser(
18315 _version: MavlinkVersion,
18316 __input: &[u8],
18317 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18318 let avail_len = __input.len();
18319 let mut payload_buf = [0; Self::ENCODED_LEN];
18320 let mut buf = if avail_len < Self::ENCODED_LEN {
18321 payload_buf[0..avail_len].copy_from_slice(__input);
18322 Bytes::new(&payload_buf)
18323 } else {
18324 Bytes::new(__input)
18325 };
18326 let mut __struct = Self::default();
18327 __struct.sequence = buf.get_u16_le();
18328 __struct.target_system = buf.get_u8();
18329 __struct.target_component = buf.get_u8();
18330 Ok(__struct)
18331 }
18332 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18333 let mut __tmp = BytesMut::new(bytes);
18334 #[allow(clippy::absurd_extreme_comparisons)]
18335 #[allow(unused_comparisons)]
18336 if __tmp.remaining() < Self::ENCODED_LEN {
18337 panic!(
18338 "buffer is too small (need {} bytes, but got {})",
18339 Self::ENCODED_LEN,
18340 __tmp.remaining(),
18341 )
18342 }
18343 __tmp.put_u16_le(self.sequence);
18344 __tmp.put_u8(self.target_system);
18345 __tmp.put_u8(self.target_component);
18346 if matches!(version, MavlinkVersion::V2) {
18347 let len = __tmp.len();
18348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18349 } else {
18350 __tmp.len()
18351 }
18352 }
18353}
18354#[doc = "id: 266"]
18355#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18356#[derive(Debug, Clone, PartialEq)]
18357#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18358#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18359pub struct LOGGING_DATA_DATA {
18360 #[doc = "sequence number (can wrap)"]
18361 pub sequence: u16,
18362 #[doc = "system ID of the target"]
18363 pub target_system: u8,
18364 #[doc = "component ID of the target"]
18365 pub target_component: u8,
18366 #[doc = "data length"]
18367 pub length: u8,
18368 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18369 pub first_message_offset: u8,
18370 #[doc = "logged data"]
18371 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18372 pub data: [u8; 249],
18373}
18374impl LOGGING_DATA_DATA {
18375 pub const ENCODED_LEN: usize = 255usize;
18376 pub const DEFAULT: Self = Self {
18377 sequence: 0_u16,
18378 target_system: 0_u8,
18379 target_component: 0_u8,
18380 length: 0_u8,
18381 first_message_offset: 0_u8,
18382 data: [0_u8; 249usize],
18383 };
18384 #[cfg(feature = "arbitrary")]
18385 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18386 use arbitrary::{Arbitrary, Unstructured};
18387 let mut buf = [0u8; 1024];
18388 rng.fill_bytes(&mut buf);
18389 let mut unstructured = Unstructured::new(&buf);
18390 Self::arbitrary(&mut unstructured).unwrap_or_default()
18391 }
18392}
18393impl Default for LOGGING_DATA_DATA {
18394 fn default() -> Self {
18395 Self::DEFAULT.clone()
18396 }
18397}
18398impl MessageData for LOGGING_DATA_DATA {
18399 type Message = MavMessage;
18400 const ID: u32 = 266u32;
18401 const NAME: &'static str = "LOGGING_DATA";
18402 const EXTRA_CRC: u8 = 193u8;
18403 const ENCODED_LEN: usize = 255usize;
18404 fn deser(
18405 _version: MavlinkVersion,
18406 __input: &[u8],
18407 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18408 let avail_len = __input.len();
18409 let mut payload_buf = [0; Self::ENCODED_LEN];
18410 let mut buf = if avail_len < Self::ENCODED_LEN {
18411 payload_buf[0..avail_len].copy_from_slice(__input);
18412 Bytes::new(&payload_buf)
18413 } else {
18414 Bytes::new(__input)
18415 };
18416 let mut __struct = Self::default();
18417 __struct.sequence = buf.get_u16_le();
18418 __struct.target_system = buf.get_u8();
18419 __struct.target_component = buf.get_u8();
18420 __struct.length = buf.get_u8();
18421 __struct.first_message_offset = buf.get_u8();
18422 for v in &mut __struct.data {
18423 let val = buf.get_u8();
18424 *v = val;
18425 }
18426 Ok(__struct)
18427 }
18428 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18429 let mut __tmp = BytesMut::new(bytes);
18430 #[allow(clippy::absurd_extreme_comparisons)]
18431 #[allow(unused_comparisons)]
18432 if __tmp.remaining() < Self::ENCODED_LEN {
18433 panic!(
18434 "buffer is too small (need {} bytes, but got {})",
18435 Self::ENCODED_LEN,
18436 __tmp.remaining(),
18437 )
18438 }
18439 __tmp.put_u16_le(self.sequence);
18440 __tmp.put_u8(self.target_system);
18441 __tmp.put_u8(self.target_component);
18442 __tmp.put_u8(self.length);
18443 __tmp.put_u8(self.first_message_offset);
18444 for val in &self.data {
18445 __tmp.put_u8(*val);
18446 }
18447 if matches!(version, MavlinkVersion::V2) {
18448 let len = __tmp.len();
18449 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18450 } else {
18451 __tmp.len()
18452 }
18453 }
18454}
18455#[doc = "id: 267"]
18456#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18457#[derive(Debug, Clone, PartialEq)]
18458#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18460pub struct LOGGING_DATA_ACKED_DATA {
18461 #[doc = "sequence number (can wrap)"]
18462 pub sequence: u16,
18463 #[doc = "system ID of the target"]
18464 pub target_system: u8,
18465 #[doc = "component ID of the target"]
18466 pub target_component: u8,
18467 #[doc = "data length"]
18468 pub length: u8,
18469 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18470 pub first_message_offset: u8,
18471 #[doc = "logged data"]
18472 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18473 pub data: [u8; 249],
18474}
18475impl LOGGING_DATA_ACKED_DATA {
18476 pub const ENCODED_LEN: usize = 255usize;
18477 pub const DEFAULT: Self = Self {
18478 sequence: 0_u16,
18479 target_system: 0_u8,
18480 target_component: 0_u8,
18481 length: 0_u8,
18482 first_message_offset: 0_u8,
18483 data: [0_u8; 249usize],
18484 };
18485 #[cfg(feature = "arbitrary")]
18486 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18487 use arbitrary::{Arbitrary, Unstructured};
18488 let mut buf = [0u8; 1024];
18489 rng.fill_bytes(&mut buf);
18490 let mut unstructured = Unstructured::new(&buf);
18491 Self::arbitrary(&mut unstructured).unwrap_or_default()
18492 }
18493}
18494impl Default for LOGGING_DATA_ACKED_DATA {
18495 fn default() -> Self {
18496 Self::DEFAULT.clone()
18497 }
18498}
18499impl MessageData for LOGGING_DATA_ACKED_DATA {
18500 type Message = MavMessage;
18501 const ID: u32 = 267u32;
18502 const NAME: &'static str = "LOGGING_DATA_ACKED";
18503 const EXTRA_CRC: u8 = 35u8;
18504 const ENCODED_LEN: usize = 255usize;
18505 fn deser(
18506 _version: MavlinkVersion,
18507 __input: &[u8],
18508 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18509 let avail_len = __input.len();
18510 let mut payload_buf = [0; Self::ENCODED_LEN];
18511 let mut buf = if avail_len < Self::ENCODED_LEN {
18512 payload_buf[0..avail_len].copy_from_slice(__input);
18513 Bytes::new(&payload_buf)
18514 } else {
18515 Bytes::new(__input)
18516 };
18517 let mut __struct = Self::default();
18518 __struct.sequence = buf.get_u16_le();
18519 __struct.target_system = buf.get_u8();
18520 __struct.target_component = buf.get_u8();
18521 __struct.length = buf.get_u8();
18522 __struct.first_message_offset = buf.get_u8();
18523 for v in &mut __struct.data {
18524 let val = buf.get_u8();
18525 *v = val;
18526 }
18527 Ok(__struct)
18528 }
18529 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18530 let mut __tmp = BytesMut::new(bytes);
18531 #[allow(clippy::absurd_extreme_comparisons)]
18532 #[allow(unused_comparisons)]
18533 if __tmp.remaining() < Self::ENCODED_LEN {
18534 panic!(
18535 "buffer is too small (need {} bytes, but got {})",
18536 Self::ENCODED_LEN,
18537 __tmp.remaining(),
18538 )
18539 }
18540 __tmp.put_u16_le(self.sequence);
18541 __tmp.put_u8(self.target_system);
18542 __tmp.put_u8(self.target_component);
18543 __tmp.put_u8(self.length);
18544 __tmp.put_u8(self.first_message_offset);
18545 for val in &self.data {
18546 __tmp.put_u8(*val);
18547 }
18548 if matches!(version, MavlinkVersion::V2) {
18549 let len = __tmp.len();
18550 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18551 } else {
18552 __tmp.len()
18553 }
18554 }
18555}
18556#[doc = "id: 120"]
18557#[doc = "Reply to LOG_REQUEST_DATA."]
18558#[derive(Debug, Clone, PartialEq)]
18559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18561pub struct LOG_DATA_DATA {
18562 #[doc = "Offset into the log"]
18563 pub ofs: u32,
18564 #[doc = "Log id (from LOG_ENTRY reply)"]
18565 pub id: u16,
18566 #[doc = "Number of bytes (zero for end of log)"]
18567 pub count: u8,
18568 #[doc = "log data"]
18569 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18570 pub data: [u8; 90],
18571}
18572impl LOG_DATA_DATA {
18573 pub const ENCODED_LEN: usize = 97usize;
18574 pub const DEFAULT: Self = Self {
18575 ofs: 0_u32,
18576 id: 0_u16,
18577 count: 0_u8,
18578 data: [0_u8; 90usize],
18579 };
18580 #[cfg(feature = "arbitrary")]
18581 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18582 use arbitrary::{Arbitrary, Unstructured};
18583 let mut buf = [0u8; 1024];
18584 rng.fill_bytes(&mut buf);
18585 let mut unstructured = Unstructured::new(&buf);
18586 Self::arbitrary(&mut unstructured).unwrap_or_default()
18587 }
18588}
18589impl Default for LOG_DATA_DATA {
18590 fn default() -> Self {
18591 Self::DEFAULT.clone()
18592 }
18593}
18594impl MessageData for LOG_DATA_DATA {
18595 type Message = MavMessage;
18596 const ID: u32 = 120u32;
18597 const NAME: &'static str = "LOG_DATA";
18598 const EXTRA_CRC: u8 = 134u8;
18599 const ENCODED_LEN: usize = 97usize;
18600 fn deser(
18601 _version: MavlinkVersion,
18602 __input: &[u8],
18603 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18604 let avail_len = __input.len();
18605 let mut payload_buf = [0; Self::ENCODED_LEN];
18606 let mut buf = if avail_len < Self::ENCODED_LEN {
18607 payload_buf[0..avail_len].copy_from_slice(__input);
18608 Bytes::new(&payload_buf)
18609 } else {
18610 Bytes::new(__input)
18611 };
18612 let mut __struct = Self::default();
18613 __struct.ofs = buf.get_u32_le();
18614 __struct.id = buf.get_u16_le();
18615 __struct.count = buf.get_u8();
18616 for v in &mut __struct.data {
18617 let val = buf.get_u8();
18618 *v = val;
18619 }
18620 Ok(__struct)
18621 }
18622 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18623 let mut __tmp = BytesMut::new(bytes);
18624 #[allow(clippy::absurd_extreme_comparisons)]
18625 #[allow(unused_comparisons)]
18626 if __tmp.remaining() < Self::ENCODED_LEN {
18627 panic!(
18628 "buffer is too small (need {} bytes, but got {})",
18629 Self::ENCODED_LEN,
18630 __tmp.remaining(),
18631 )
18632 }
18633 __tmp.put_u32_le(self.ofs);
18634 __tmp.put_u16_le(self.id);
18635 __tmp.put_u8(self.count);
18636 for val in &self.data {
18637 __tmp.put_u8(*val);
18638 }
18639 if matches!(version, MavlinkVersion::V2) {
18640 let len = __tmp.len();
18641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18642 } else {
18643 __tmp.len()
18644 }
18645 }
18646}
18647#[doc = "id: 118"]
18648#[doc = "Reply to LOG_REQUEST_LIST."]
18649#[derive(Debug, Clone, PartialEq)]
18650#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18652pub struct LOG_ENTRY_DATA {
18653 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18654 pub time_utc: u32,
18655 #[doc = "Size of the log (may be approximate)"]
18656 pub size: u32,
18657 #[doc = "Log id"]
18658 pub id: u16,
18659 #[doc = "Total number of logs"]
18660 pub num_logs: u16,
18661 #[doc = "High log number"]
18662 pub last_log_num: u16,
18663}
18664impl LOG_ENTRY_DATA {
18665 pub const ENCODED_LEN: usize = 14usize;
18666 pub const DEFAULT: Self = Self {
18667 time_utc: 0_u32,
18668 size: 0_u32,
18669 id: 0_u16,
18670 num_logs: 0_u16,
18671 last_log_num: 0_u16,
18672 };
18673 #[cfg(feature = "arbitrary")]
18674 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18675 use arbitrary::{Arbitrary, Unstructured};
18676 let mut buf = [0u8; 1024];
18677 rng.fill_bytes(&mut buf);
18678 let mut unstructured = Unstructured::new(&buf);
18679 Self::arbitrary(&mut unstructured).unwrap_or_default()
18680 }
18681}
18682impl Default for LOG_ENTRY_DATA {
18683 fn default() -> Self {
18684 Self::DEFAULT.clone()
18685 }
18686}
18687impl MessageData for LOG_ENTRY_DATA {
18688 type Message = MavMessage;
18689 const ID: u32 = 118u32;
18690 const NAME: &'static str = "LOG_ENTRY";
18691 const EXTRA_CRC: u8 = 56u8;
18692 const ENCODED_LEN: usize = 14usize;
18693 fn deser(
18694 _version: MavlinkVersion,
18695 __input: &[u8],
18696 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18697 let avail_len = __input.len();
18698 let mut payload_buf = [0; Self::ENCODED_LEN];
18699 let mut buf = if avail_len < Self::ENCODED_LEN {
18700 payload_buf[0..avail_len].copy_from_slice(__input);
18701 Bytes::new(&payload_buf)
18702 } else {
18703 Bytes::new(__input)
18704 };
18705 let mut __struct = Self::default();
18706 __struct.time_utc = buf.get_u32_le();
18707 __struct.size = buf.get_u32_le();
18708 __struct.id = buf.get_u16_le();
18709 __struct.num_logs = buf.get_u16_le();
18710 __struct.last_log_num = buf.get_u16_le();
18711 Ok(__struct)
18712 }
18713 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18714 let mut __tmp = BytesMut::new(bytes);
18715 #[allow(clippy::absurd_extreme_comparisons)]
18716 #[allow(unused_comparisons)]
18717 if __tmp.remaining() < Self::ENCODED_LEN {
18718 panic!(
18719 "buffer is too small (need {} bytes, but got {})",
18720 Self::ENCODED_LEN,
18721 __tmp.remaining(),
18722 )
18723 }
18724 __tmp.put_u32_le(self.time_utc);
18725 __tmp.put_u32_le(self.size);
18726 __tmp.put_u16_le(self.id);
18727 __tmp.put_u16_le(self.num_logs);
18728 __tmp.put_u16_le(self.last_log_num);
18729 if matches!(version, MavlinkVersion::V2) {
18730 let len = __tmp.len();
18731 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18732 } else {
18733 __tmp.len()
18734 }
18735 }
18736}
18737#[doc = "id: 121"]
18738#[doc = "Erase all logs."]
18739#[derive(Debug, Clone, PartialEq)]
18740#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18742pub struct LOG_ERASE_DATA {
18743 #[doc = "System ID"]
18744 pub target_system: u8,
18745 #[doc = "Component ID"]
18746 pub target_component: u8,
18747}
18748impl LOG_ERASE_DATA {
18749 pub const ENCODED_LEN: usize = 2usize;
18750 pub const DEFAULT: Self = Self {
18751 target_system: 0_u8,
18752 target_component: 0_u8,
18753 };
18754 #[cfg(feature = "arbitrary")]
18755 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18756 use arbitrary::{Arbitrary, Unstructured};
18757 let mut buf = [0u8; 1024];
18758 rng.fill_bytes(&mut buf);
18759 let mut unstructured = Unstructured::new(&buf);
18760 Self::arbitrary(&mut unstructured).unwrap_or_default()
18761 }
18762}
18763impl Default for LOG_ERASE_DATA {
18764 fn default() -> Self {
18765 Self::DEFAULT.clone()
18766 }
18767}
18768impl MessageData for LOG_ERASE_DATA {
18769 type Message = MavMessage;
18770 const ID: u32 = 121u32;
18771 const NAME: &'static str = "LOG_ERASE";
18772 const EXTRA_CRC: u8 = 237u8;
18773 const ENCODED_LEN: usize = 2usize;
18774 fn deser(
18775 _version: MavlinkVersion,
18776 __input: &[u8],
18777 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18778 let avail_len = __input.len();
18779 let mut payload_buf = [0; Self::ENCODED_LEN];
18780 let mut buf = if avail_len < Self::ENCODED_LEN {
18781 payload_buf[0..avail_len].copy_from_slice(__input);
18782 Bytes::new(&payload_buf)
18783 } else {
18784 Bytes::new(__input)
18785 };
18786 let mut __struct = Self::default();
18787 __struct.target_system = buf.get_u8();
18788 __struct.target_component = buf.get_u8();
18789 Ok(__struct)
18790 }
18791 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18792 let mut __tmp = BytesMut::new(bytes);
18793 #[allow(clippy::absurd_extreme_comparisons)]
18794 #[allow(unused_comparisons)]
18795 if __tmp.remaining() < Self::ENCODED_LEN {
18796 panic!(
18797 "buffer is too small (need {} bytes, but got {})",
18798 Self::ENCODED_LEN,
18799 __tmp.remaining(),
18800 )
18801 }
18802 __tmp.put_u8(self.target_system);
18803 __tmp.put_u8(self.target_component);
18804 if matches!(version, MavlinkVersion::V2) {
18805 let len = __tmp.len();
18806 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18807 } else {
18808 __tmp.len()
18809 }
18810 }
18811}
18812#[doc = "id: 119"]
18813#[doc = "Request a chunk of a log."]
18814#[derive(Debug, Clone, PartialEq)]
18815#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18817pub struct LOG_REQUEST_DATA_DATA {
18818 #[doc = "Offset into the log"]
18819 pub ofs: u32,
18820 #[doc = "Number of bytes"]
18821 pub count: u32,
18822 #[doc = "Log id (from LOG_ENTRY reply)"]
18823 pub id: u16,
18824 #[doc = "System ID"]
18825 pub target_system: u8,
18826 #[doc = "Component ID"]
18827 pub target_component: u8,
18828}
18829impl LOG_REQUEST_DATA_DATA {
18830 pub const ENCODED_LEN: usize = 12usize;
18831 pub const DEFAULT: Self = Self {
18832 ofs: 0_u32,
18833 count: 0_u32,
18834 id: 0_u16,
18835 target_system: 0_u8,
18836 target_component: 0_u8,
18837 };
18838 #[cfg(feature = "arbitrary")]
18839 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18840 use arbitrary::{Arbitrary, Unstructured};
18841 let mut buf = [0u8; 1024];
18842 rng.fill_bytes(&mut buf);
18843 let mut unstructured = Unstructured::new(&buf);
18844 Self::arbitrary(&mut unstructured).unwrap_or_default()
18845 }
18846}
18847impl Default for LOG_REQUEST_DATA_DATA {
18848 fn default() -> Self {
18849 Self::DEFAULT.clone()
18850 }
18851}
18852impl MessageData for LOG_REQUEST_DATA_DATA {
18853 type Message = MavMessage;
18854 const ID: u32 = 119u32;
18855 const NAME: &'static str = "LOG_REQUEST_DATA";
18856 const EXTRA_CRC: u8 = 116u8;
18857 const ENCODED_LEN: usize = 12usize;
18858 fn deser(
18859 _version: MavlinkVersion,
18860 __input: &[u8],
18861 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18862 let avail_len = __input.len();
18863 let mut payload_buf = [0; Self::ENCODED_LEN];
18864 let mut buf = if avail_len < Self::ENCODED_LEN {
18865 payload_buf[0..avail_len].copy_from_slice(__input);
18866 Bytes::new(&payload_buf)
18867 } else {
18868 Bytes::new(__input)
18869 };
18870 let mut __struct = Self::default();
18871 __struct.ofs = buf.get_u32_le();
18872 __struct.count = buf.get_u32_le();
18873 __struct.id = buf.get_u16_le();
18874 __struct.target_system = buf.get_u8();
18875 __struct.target_component = buf.get_u8();
18876 Ok(__struct)
18877 }
18878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18879 let mut __tmp = BytesMut::new(bytes);
18880 #[allow(clippy::absurd_extreme_comparisons)]
18881 #[allow(unused_comparisons)]
18882 if __tmp.remaining() < Self::ENCODED_LEN {
18883 panic!(
18884 "buffer is too small (need {} bytes, but got {})",
18885 Self::ENCODED_LEN,
18886 __tmp.remaining(),
18887 )
18888 }
18889 __tmp.put_u32_le(self.ofs);
18890 __tmp.put_u32_le(self.count);
18891 __tmp.put_u16_le(self.id);
18892 __tmp.put_u8(self.target_system);
18893 __tmp.put_u8(self.target_component);
18894 if matches!(version, MavlinkVersion::V2) {
18895 let len = __tmp.len();
18896 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18897 } else {
18898 __tmp.len()
18899 }
18900 }
18901}
18902#[doc = "id: 122"]
18903#[doc = "Stop log transfer and resume normal logging."]
18904#[derive(Debug, Clone, PartialEq)]
18905#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18907pub struct LOG_REQUEST_END_DATA {
18908 #[doc = "System ID"]
18909 pub target_system: u8,
18910 #[doc = "Component ID"]
18911 pub target_component: u8,
18912}
18913impl LOG_REQUEST_END_DATA {
18914 pub const ENCODED_LEN: usize = 2usize;
18915 pub const DEFAULT: Self = Self {
18916 target_system: 0_u8,
18917 target_component: 0_u8,
18918 };
18919 #[cfg(feature = "arbitrary")]
18920 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18921 use arbitrary::{Arbitrary, Unstructured};
18922 let mut buf = [0u8; 1024];
18923 rng.fill_bytes(&mut buf);
18924 let mut unstructured = Unstructured::new(&buf);
18925 Self::arbitrary(&mut unstructured).unwrap_or_default()
18926 }
18927}
18928impl Default for LOG_REQUEST_END_DATA {
18929 fn default() -> Self {
18930 Self::DEFAULT.clone()
18931 }
18932}
18933impl MessageData for LOG_REQUEST_END_DATA {
18934 type Message = MavMessage;
18935 const ID: u32 = 122u32;
18936 const NAME: &'static str = "LOG_REQUEST_END";
18937 const EXTRA_CRC: u8 = 203u8;
18938 const ENCODED_LEN: usize = 2usize;
18939 fn deser(
18940 _version: MavlinkVersion,
18941 __input: &[u8],
18942 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18943 let avail_len = __input.len();
18944 let mut payload_buf = [0; Self::ENCODED_LEN];
18945 let mut buf = if avail_len < Self::ENCODED_LEN {
18946 payload_buf[0..avail_len].copy_from_slice(__input);
18947 Bytes::new(&payload_buf)
18948 } else {
18949 Bytes::new(__input)
18950 };
18951 let mut __struct = Self::default();
18952 __struct.target_system = buf.get_u8();
18953 __struct.target_component = buf.get_u8();
18954 Ok(__struct)
18955 }
18956 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18957 let mut __tmp = BytesMut::new(bytes);
18958 #[allow(clippy::absurd_extreme_comparisons)]
18959 #[allow(unused_comparisons)]
18960 if __tmp.remaining() < Self::ENCODED_LEN {
18961 panic!(
18962 "buffer is too small (need {} bytes, but got {})",
18963 Self::ENCODED_LEN,
18964 __tmp.remaining(),
18965 )
18966 }
18967 __tmp.put_u8(self.target_system);
18968 __tmp.put_u8(self.target_component);
18969 if matches!(version, MavlinkVersion::V2) {
18970 let len = __tmp.len();
18971 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18972 } else {
18973 __tmp.len()
18974 }
18975 }
18976}
18977#[doc = "id: 117"]
18978#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18979#[derive(Debug, Clone, PartialEq)]
18980#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18981#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18982pub struct LOG_REQUEST_LIST_DATA {
18983 #[doc = "First log id (0 for first available)"]
18984 pub start: u16,
18985 #[doc = "Last log id (0xffff for last available)"]
18986 pub end: u16,
18987 #[doc = "System ID"]
18988 pub target_system: u8,
18989 #[doc = "Component ID"]
18990 pub target_component: u8,
18991}
18992impl LOG_REQUEST_LIST_DATA {
18993 pub const ENCODED_LEN: usize = 6usize;
18994 pub const DEFAULT: Self = Self {
18995 start: 0_u16,
18996 end: 0_u16,
18997 target_system: 0_u8,
18998 target_component: 0_u8,
18999 };
19000 #[cfg(feature = "arbitrary")]
19001 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19002 use arbitrary::{Arbitrary, Unstructured};
19003 let mut buf = [0u8; 1024];
19004 rng.fill_bytes(&mut buf);
19005 let mut unstructured = Unstructured::new(&buf);
19006 Self::arbitrary(&mut unstructured).unwrap_or_default()
19007 }
19008}
19009impl Default for LOG_REQUEST_LIST_DATA {
19010 fn default() -> Self {
19011 Self::DEFAULT.clone()
19012 }
19013}
19014impl MessageData for LOG_REQUEST_LIST_DATA {
19015 type Message = MavMessage;
19016 const ID: u32 = 117u32;
19017 const NAME: &'static str = "LOG_REQUEST_LIST";
19018 const EXTRA_CRC: u8 = 128u8;
19019 const ENCODED_LEN: usize = 6usize;
19020 fn deser(
19021 _version: MavlinkVersion,
19022 __input: &[u8],
19023 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19024 let avail_len = __input.len();
19025 let mut payload_buf = [0; Self::ENCODED_LEN];
19026 let mut buf = if avail_len < Self::ENCODED_LEN {
19027 payload_buf[0..avail_len].copy_from_slice(__input);
19028 Bytes::new(&payload_buf)
19029 } else {
19030 Bytes::new(__input)
19031 };
19032 let mut __struct = Self::default();
19033 __struct.start = buf.get_u16_le();
19034 __struct.end = buf.get_u16_le();
19035 __struct.target_system = buf.get_u8();
19036 __struct.target_component = buf.get_u8();
19037 Ok(__struct)
19038 }
19039 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19040 let mut __tmp = BytesMut::new(bytes);
19041 #[allow(clippy::absurd_extreme_comparisons)]
19042 #[allow(unused_comparisons)]
19043 if __tmp.remaining() < Self::ENCODED_LEN {
19044 panic!(
19045 "buffer is too small (need {} bytes, but got {})",
19046 Self::ENCODED_LEN,
19047 __tmp.remaining(),
19048 )
19049 }
19050 __tmp.put_u16_le(self.start);
19051 __tmp.put_u16_le(self.end);
19052 __tmp.put_u8(self.target_system);
19053 __tmp.put_u8(self.target_component);
19054 if matches!(version, MavlinkVersion::V2) {
19055 let len = __tmp.len();
19056 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19057 } else {
19058 __tmp.len()
19059 }
19060 }
19061}
19062#[doc = "id: 192"]
19063#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
19064#[derive(Debug, Clone, PartialEq)]
19065#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19066#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19067pub struct MAG_CAL_REPORT_DATA {
19068 #[doc = "RMS milligauss residuals."]
19069 pub fitness: f32,
19070 #[doc = "X offset."]
19071 pub ofs_x: f32,
19072 #[doc = "Y offset."]
19073 pub ofs_y: f32,
19074 #[doc = "Z offset."]
19075 pub ofs_z: f32,
19076 #[doc = "X diagonal (matrix 11)."]
19077 pub diag_x: f32,
19078 #[doc = "Y diagonal (matrix 22)."]
19079 pub diag_y: f32,
19080 #[doc = "Z diagonal (matrix 33)."]
19081 pub diag_z: f32,
19082 #[doc = "X off-diagonal (matrix 12 and 21)."]
19083 pub offdiag_x: f32,
19084 #[doc = "Y off-diagonal (matrix 13 and 31)."]
19085 pub offdiag_y: f32,
19086 #[doc = "Z off-diagonal (matrix 32 and 23)."]
19087 pub offdiag_z: f32,
19088 #[doc = "Compass being calibrated."]
19089 pub compass_id: u8,
19090 #[doc = "Bitmask of compasses being calibrated."]
19091 pub cal_mask: u8,
19092 #[doc = "Calibration Status."]
19093 pub cal_status: MagCalStatus,
19094 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
19095 pub autosaved: u8,
19096 #[doc = "Confidence in orientation (higher is better)."]
19097 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19098 pub orientation_confidence: f32,
19099 #[doc = "orientation before calibration."]
19100 #[cfg_attr(feature = "serde", serde(default))]
19101 pub old_orientation: MavSensorOrientation,
19102 #[doc = "orientation after calibration."]
19103 #[cfg_attr(feature = "serde", serde(default))]
19104 pub new_orientation: MavSensorOrientation,
19105 #[doc = "field radius correction factor"]
19106 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19107 pub scale_factor: f32,
19108}
19109impl MAG_CAL_REPORT_DATA {
19110 pub const ENCODED_LEN: usize = 54usize;
19111 pub const DEFAULT: Self = Self {
19112 fitness: 0.0_f32,
19113 ofs_x: 0.0_f32,
19114 ofs_y: 0.0_f32,
19115 ofs_z: 0.0_f32,
19116 diag_x: 0.0_f32,
19117 diag_y: 0.0_f32,
19118 diag_z: 0.0_f32,
19119 offdiag_x: 0.0_f32,
19120 offdiag_y: 0.0_f32,
19121 offdiag_z: 0.0_f32,
19122 compass_id: 0_u8,
19123 cal_mask: 0_u8,
19124 cal_status: MagCalStatus::DEFAULT,
19125 autosaved: 0_u8,
19126 orientation_confidence: 0.0_f32,
19127 old_orientation: MavSensorOrientation::DEFAULT,
19128 new_orientation: MavSensorOrientation::DEFAULT,
19129 scale_factor: 0.0_f32,
19130 };
19131 #[cfg(feature = "arbitrary")]
19132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19133 use arbitrary::{Arbitrary, Unstructured};
19134 let mut buf = [0u8; 1024];
19135 rng.fill_bytes(&mut buf);
19136 let mut unstructured = Unstructured::new(&buf);
19137 Self::arbitrary(&mut unstructured).unwrap_or_default()
19138 }
19139}
19140impl Default for MAG_CAL_REPORT_DATA {
19141 fn default() -> Self {
19142 Self::DEFAULT.clone()
19143 }
19144}
19145impl MessageData for MAG_CAL_REPORT_DATA {
19146 type Message = MavMessage;
19147 const ID: u32 = 192u32;
19148 const NAME: &'static str = "MAG_CAL_REPORT";
19149 const EXTRA_CRC: u8 = 36u8;
19150 const ENCODED_LEN: usize = 54usize;
19151 fn deser(
19152 _version: MavlinkVersion,
19153 __input: &[u8],
19154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19155 let avail_len = __input.len();
19156 let mut payload_buf = [0; Self::ENCODED_LEN];
19157 let mut buf = if avail_len < Self::ENCODED_LEN {
19158 payload_buf[0..avail_len].copy_from_slice(__input);
19159 Bytes::new(&payload_buf)
19160 } else {
19161 Bytes::new(__input)
19162 };
19163 let mut __struct = Self::default();
19164 __struct.fitness = buf.get_f32_le();
19165 __struct.ofs_x = buf.get_f32_le();
19166 __struct.ofs_y = buf.get_f32_le();
19167 __struct.ofs_z = buf.get_f32_le();
19168 __struct.diag_x = buf.get_f32_le();
19169 __struct.diag_y = buf.get_f32_le();
19170 __struct.diag_z = buf.get_f32_le();
19171 __struct.offdiag_x = buf.get_f32_le();
19172 __struct.offdiag_y = buf.get_f32_le();
19173 __struct.offdiag_z = buf.get_f32_le();
19174 __struct.compass_id = buf.get_u8();
19175 __struct.cal_mask = buf.get_u8();
19176 let tmp = buf.get_u8();
19177 __struct.cal_status =
19178 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19179 enum_type: "MagCalStatus",
19180 value: tmp as u32,
19181 })?;
19182 __struct.autosaved = buf.get_u8();
19183 __struct.orientation_confidence = buf.get_f32_le();
19184 let tmp = buf.get_u8();
19185 __struct.old_orientation =
19186 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19187 enum_type: "MavSensorOrientation",
19188 value: tmp as u32,
19189 })?;
19190 let tmp = buf.get_u8();
19191 __struct.new_orientation =
19192 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19193 enum_type: "MavSensorOrientation",
19194 value: tmp as u32,
19195 })?;
19196 __struct.scale_factor = buf.get_f32_le();
19197 Ok(__struct)
19198 }
19199 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19200 let mut __tmp = BytesMut::new(bytes);
19201 #[allow(clippy::absurd_extreme_comparisons)]
19202 #[allow(unused_comparisons)]
19203 if __tmp.remaining() < Self::ENCODED_LEN {
19204 panic!(
19205 "buffer is too small (need {} bytes, but got {})",
19206 Self::ENCODED_LEN,
19207 __tmp.remaining(),
19208 )
19209 }
19210 __tmp.put_f32_le(self.fitness);
19211 __tmp.put_f32_le(self.ofs_x);
19212 __tmp.put_f32_le(self.ofs_y);
19213 __tmp.put_f32_le(self.ofs_z);
19214 __tmp.put_f32_le(self.diag_x);
19215 __tmp.put_f32_le(self.diag_y);
19216 __tmp.put_f32_le(self.diag_z);
19217 __tmp.put_f32_le(self.offdiag_x);
19218 __tmp.put_f32_le(self.offdiag_y);
19219 __tmp.put_f32_le(self.offdiag_z);
19220 __tmp.put_u8(self.compass_id);
19221 __tmp.put_u8(self.cal_mask);
19222 __tmp.put_u8(self.cal_status as u8);
19223 __tmp.put_u8(self.autosaved);
19224 __tmp.put_f32_le(self.orientation_confidence);
19225 __tmp.put_u8(self.old_orientation as u8);
19226 __tmp.put_u8(self.new_orientation as u8);
19227 __tmp.put_f32_le(self.scale_factor);
19228 if matches!(version, MavlinkVersion::V2) {
19229 let len = __tmp.len();
19230 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19231 } else {
19232 __tmp.len()
19233 }
19234 }
19235}
19236#[doc = "id: 69"]
19237#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19238#[derive(Debug, Clone, PartialEq)]
19239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19241pub struct MANUAL_CONTROL_DATA {
19242 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19243 pub x: i16,
19244 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19245 pub y: i16,
19246 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19247 pub z: i16,
19248 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19249 pub r: i16,
19250 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19251 pub buttons: u16,
19252 #[doc = "The system to be controlled."]
19253 pub target: u8,
19254 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19255 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19256 pub buttons2: u16,
19257 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19258 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19259 pub enabled_extensions: u8,
19260 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19261 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19262 pub s: i16,
19263 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19264 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19265 pub t: i16,
19266 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19267 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19268 pub aux1: i16,
19269 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19270 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19271 pub aux2: i16,
19272 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19273 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19274 pub aux3: i16,
19275 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19276 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19277 pub aux4: i16,
19278 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19279 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19280 pub aux5: i16,
19281 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19282 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19283 pub aux6: i16,
19284}
19285impl MANUAL_CONTROL_DATA {
19286 pub const ENCODED_LEN: usize = 30usize;
19287 pub const DEFAULT: Self = Self {
19288 x: 0_i16,
19289 y: 0_i16,
19290 z: 0_i16,
19291 r: 0_i16,
19292 buttons: 0_u16,
19293 target: 0_u8,
19294 buttons2: 0_u16,
19295 enabled_extensions: 0_u8,
19296 s: 0_i16,
19297 t: 0_i16,
19298 aux1: 0_i16,
19299 aux2: 0_i16,
19300 aux3: 0_i16,
19301 aux4: 0_i16,
19302 aux5: 0_i16,
19303 aux6: 0_i16,
19304 };
19305 #[cfg(feature = "arbitrary")]
19306 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19307 use arbitrary::{Arbitrary, Unstructured};
19308 let mut buf = [0u8; 1024];
19309 rng.fill_bytes(&mut buf);
19310 let mut unstructured = Unstructured::new(&buf);
19311 Self::arbitrary(&mut unstructured).unwrap_or_default()
19312 }
19313}
19314impl Default for MANUAL_CONTROL_DATA {
19315 fn default() -> Self {
19316 Self::DEFAULT.clone()
19317 }
19318}
19319impl MessageData for MANUAL_CONTROL_DATA {
19320 type Message = MavMessage;
19321 const ID: u32 = 69u32;
19322 const NAME: &'static str = "MANUAL_CONTROL";
19323 const EXTRA_CRC: u8 = 243u8;
19324 const ENCODED_LEN: usize = 30usize;
19325 fn deser(
19326 _version: MavlinkVersion,
19327 __input: &[u8],
19328 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19329 let avail_len = __input.len();
19330 let mut payload_buf = [0; Self::ENCODED_LEN];
19331 let mut buf = if avail_len < Self::ENCODED_LEN {
19332 payload_buf[0..avail_len].copy_from_slice(__input);
19333 Bytes::new(&payload_buf)
19334 } else {
19335 Bytes::new(__input)
19336 };
19337 let mut __struct = Self::default();
19338 __struct.x = buf.get_i16_le();
19339 __struct.y = buf.get_i16_le();
19340 __struct.z = buf.get_i16_le();
19341 __struct.r = buf.get_i16_le();
19342 __struct.buttons = buf.get_u16_le();
19343 __struct.target = buf.get_u8();
19344 __struct.buttons2 = buf.get_u16_le();
19345 __struct.enabled_extensions = buf.get_u8();
19346 __struct.s = buf.get_i16_le();
19347 __struct.t = buf.get_i16_le();
19348 __struct.aux1 = buf.get_i16_le();
19349 __struct.aux2 = buf.get_i16_le();
19350 __struct.aux3 = buf.get_i16_le();
19351 __struct.aux4 = buf.get_i16_le();
19352 __struct.aux5 = buf.get_i16_le();
19353 __struct.aux6 = buf.get_i16_le();
19354 Ok(__struct)
19355 }
19356 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19357 let mut __tmp = BytesMut::new(bytes);
19358 #[allow(clippy::absurd_extreme_comparisons)]
19359 #[allow(unused_comparisons)]
19360 if __tmp.remaining() < Self::ENCODED_LEN {
19361 panic!(
19362 "buffer is too small (need {} bytes, but got {})",
19363 Self::ENCODED_LEN,
19364 __tmp.remaining(),
19365 )
19366 }
19367 __tmp.put_i16_le(self.x);
19368 __tmp.put_i16_le(self.y);
19369 __tmp.put_i16_le(self.z);
19370 __tmp.put_i16_le(self.r);
19371 __tmp.put_u16_le(self.buttons);
19372 __tmp.put_u8(self.target);
19373 __tmp.put_u16_le(self.buttons2);
19374 __tmp.put_u8(self.enabled_extensions);
19375 __tmp.put_i16_le(self.s);
19376 __tmp.put_i16_le(self.t);
19377 __tmp.put_i16_le(self.aux1);
19378 __tmp.put_i16_le(self.aux2);
19379 __tmp.put_i16_le(self.aux3);
19380 __tmp.put_i16_le(self.aux4);
19381 __tmp.put_i16_le(self.aux5);
19382 __tmp.put_i16_le(self.aux6);
19383 if matches!(version, MavlinkVersion::V2) {
19384 let len = __tmp.len();
19385 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19386 } else {
19387 __tmp.len()
19388 }
19389 }
19390}
19391#[doc = "id: 81"]
19392#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19393#[derive(Debug, Clone, PartialEq)]
19394#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19396pub struct MANUAL_SETPOINT_DATA {
19397 #[doc = "Timestamp (time since system boot)."]
19398 pub time_boot_ms: u32,
19399 #[doc = "Desired roll rate"]
19400 pub roll: f32,
19401 #[doc = "Desired pitch rate"]
19402 pub pitch: f32,
19403 #[doc = "Desired yaw rate"]
19404 pub yaw: f32,
19405 #[doc = "Collective thrust, normalized to 0 .. 1"]
19406 pub thrust: f32,
19407 #[doc = "Flight mode switch position, 0.. 255"]
19408 pub mode_switch: u8,
19409 #[doc = "Override mode switch position, 0.. 255"]
19410 pub manual_override_switch: u8,
19411}
19412impl MANUAL_SETPOINT_DATA {
19413 pub const ENCODED_LEN: usize = 22usize;
19414 pub const DEFAULT: Self = Self {
19415 time_boot_ms: 0_u32,
19416 roll: 0.0_f32,
19417 pitch: 0.0_f32,
19418 yaw: 0.0_f32,
19419 thrust: 0.0_f32,
19420 mode_switch: 0_u8,
19421 manual_override_switch: 0_u8,
19422 };
19423 #[cfg(feature = "arbitrary")]
19424 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19425 use arbitrary::{Arbitrary, Unstructured};
19426 let mut buf = [0u8; 1024];
19427 rng.fill_bytes(&mut buf);
19428 let mut unstructured = Unstructured::new(&buf);
19429 Self::arbitrary(&mut unstructured).unwrap_or_default()
19430 }
19431}
19432impl Default for MANUAL_SETPOINT_DATA {
19433 fn default() -> Self {
19434 Self::DEFAULT.clone()
19435 }
19436}
19437impl MessageData for MANUAL_SETPOINT_DATA {
19438 type Message = MavMessage;
19439 const ID: u32 = 81u32;
19440 const NAME: &'static str = "MANUAL_SETPOINT";
19441 const EXTRA_CRC: u8 = 106u8;
19442 const ENCODED_LEN: usize = 22usize;
19443 fn deser(
19444 _version: MavlinkVersion,
19445 __input: &[u8],
19446 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19447 let avail_len = __input.len();
19448 let mut payload_buf = [0; Self::ENCODED_LEN];
19449 let mut buf = if avail_len < Self::ENCODED_LEN {
19450 payload_buf[0..avail_len].copy_from_slice(__input);
19451 Bytes::new(&payload_buf)
19452 } else {
19453 Bytes::new(__input)
19454 };
19455 let mut __struct = Self::default();
19456 __struct.time_boot_ms = buf.get_u32_le();
19457 __struct.roll = buf.get_f32_le();
19458 __struct.pitch = buf.get_f32_le();
19459 __struct.yaw = buf.get_f32_le();
19460 __struct.thrust = buf.get_f32_le();
19461 __struct.mode_switch = buf.get_u8();
19462 __struct.manual_override_switch = buf.get_u8();
19463 Ok(__struct)
19464 }
19465 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19466 let mut __tmp = BytesMut::new(bytes);
19467 #[allow(clippy::absurd_extreme_comparisons)]
19468 #[allow(unused_comparisons)]
19469 if __tmp.remaining() < Self::ENCODED_LEN {
19470 panic!(
19471 "buffer is too small (need {} bytes, but got {})",
19472 Self::ENCODED_LEN,
19473 __tmp.remaining(),
19474 )
19475 }
19476 __tmp.put_u32_le(self.time_boot_ms);
19477 __tmp.put_f32_le(self.roll);
19478 __tmp.put_f32_le(self.pitch);
19479 __tmp.put_f32_le(self.yaw);
19480 __tmp.put_f32_le(self.thrust);
19481 __tmp.put_u8(self.mode_switch);
19482 __tmp.put_u8(self.manual_override_switch);
19483 if matches!(version, MavlinkVersion::V2) {
19484 let len = __tmp.len();
19485 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19486 } else {
19487 __tmp.len()
19488 }
19489 }
19490}
19491#[doc = "id: 249"]
19492#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19493#[derive(Debug, Clone, PartialEq)]
19494#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19495#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19496pub struct MEMORY_VECT_DATA {
19497 #[doc = "Starting address of the debug variables"]
19498 pub address: u16,
19499 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19500 pub ver: u8,
19501 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19502 pub mavtype: u8,
19503 #[doc = "Memory contents at specified address"]
19504 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19505 pub value: [i8; 32],
19506}
19507impl MEMORY_VECT_DATA {
19508 pub const ENCODED_LEN: usize = 36usize;
19509 pub const DEFAULT: Self = Self {
19510 address: 0_u16,
19511 ver: 0_u8,
19512 mavtype: 0_u8,
19513 value: [0_i8; 32usize],
19514 };
19515 #[cfg(feature = "arbitrary")]
19516 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19517 use arbitrary::{Arbitrary, Unstructured};
19518 let mut buf = [0u8; 1024];
19519 rng.fill_bytes(&mut buf);
19520 let mut unstructured = Unstructured::new(&buf);
19521 Self::arbitrary(&mut unstructured).unwrap_or_default()
19522 }
19523}
19524impl Default for MEMORY_VECT_DATA {
19525 fn default() -> Self {
19526 Self::DEFAULT.clone()
19527 }
19528}
19529impl MessageData for MEMORY_VECT_DATA {
19530 type Message = MavMessage;
19531 const ID: u32 = 249u32;
19532 const NAME: &'static str = "MEMORY_VECT";
19533 const EXTRA_CRC: u8 = 204u8;
19534 const ENCODED_LEN: usize = 36usize;
19535 fn deser(
19536 _version: MavlinkVersion,
19537 __input: &[u8],
19538 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19539 let avail_len = __input.len();
19540 let mut payload_buf = [0; Self::ENCODED_LEN];
19541 let mut buf = if avail_len < Self::ENCODED_LEN {
19542 payload_buf[0..avail_len].copy_from_slice(__input);
19543 Bytes::new(&payload_buf)
19544 } else {
19545 Bytes::new(__input)
19546 };
19547 let mut __struct = Self::default();
19548 __struct.address = buf.get_u16_le();
19549 __struct.ver = buf.get_u8();
19550 __struct.mavtype = buf.get_u8();
19551 for v in &mut __struct.value {
19552 let val = buf.get_i8();
19553 *v = val;
19554 }
19555 Ok(__struct)
19556 }
19557 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19558 let mut __tmp = BytesMut::new(bytes);
19559 #[allow(clippy::absurd_extreme_comparisons)]
19560 #[allow(unused_comparisons)]
19561 if __tmp.remaining() < Self::ENCODED_LEN {
19562 panic!(
19563 "buffer is too small (need {} bytes, but got {})",
19564 Self::ENCODED_LEN,
19565 __tmp.remaining(),
19566 )
19567 }
19568 __tmp.put_u16_le(self.address);
19569 __tmp.put_u8(self.ver);
19570 __tmp.put_u8(self.mavtype);
19571 for val in &self.value {
19572 __tmp.put_i8(*val);
19573 }
19574 if matches!(version, MavlinkVersion::V2) {
19575 let len = __tmp.len();
19576 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19577 } else {
19578 __tmp.len()
19579 }
19580 }
19581}
19582#[doc = "id: 244"]
19583#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19584#[derive(Debug, Clone, PartialEq)]
19585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19587pub struct MESSAGE_INTERVAL_DATA {
19588 #[doc = "0 indicates the interval at which it is sent."]
19589 pub interval_us: i32,
19590 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19591 pub message_id: u16,
19592}
19593impl MESSAGE_INTERVAL_DATA {
19594 pub const ENCODED_LEN: usize = 6usize;
19595 pub const DEFAULT: Self = Self {
19596 interval_us: 0_i32,
19597 message_id: 0_u16,
19598 };
19599 #[cfg(feature = "arbitrary")]
19600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19601 use arbitrary::{Arbitrary, Unstructured};
19602 let mut buf = [0u8; 1024];
19603 rng.fill_bytes(&mut buf);
19604 let mut unstructured = Unstructured::new(&buf);
19605 Self::arbitrary(&mut unstructured).unwrap_or_default()
19606 }
19607}
19608impl Default for MESSAGE_INTERVAL_DATA {
19609 fn default() -> Self {
19610 Self::DEFAULT.clone()
19611 }
19612}
19613impl MessageData for MESSAGE_INTERVAL_DATA {
19614 type Message = MavMessage;
19615 const ID: u32 = 244u32;
19616 const NAME: &'static str = "MESSAGE_INTERVAL";
19617 const EXTRA_CRC: u8 = 95u8;
19618 const ENCODED_LEN: usize = 6usize;
19619 fn deser(
19620 _version: MavlinkVersion,
19621 __input: &[u8],
19622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19623 let avail_len = __input.len();
19624 let mut payload_buf = [0; Self::ENCODED_LEN];
19625 let mut buf = if avail_len < Self::ENCODED_LEN {
19626 payload_buf[0..avail_len].copy_from_slice(__input);
19627 Bytes::new(&payload_buf)
19628 } else {
19629 Bytes::new(__input)
19630 };
19631 let mut __struct = Self::default();
19632 __struct.interval_us = buf.get_i32_le();
19633 __struct.message_id = buf.get_u16_le();
19634 Ok(__struct)
19635 }
19636 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19637 let mut __tmp = BytesMut::new(bytes);
19638 #[allow(clippy::absurd_extreme_comparisons)]
19639 #[allow(unused_comparisons)]
19640 if __tmp.remaining() < Self::ENCODED_LEN {
19641 panic!(
19642 "buffer is too small (need {} bytes, but got {})",
19643 Self::ENCODED_LEN,
19644 __tmp.remaining(),
19645 )
19646 }
19647 __tmp.put_i32_le(self.interval_us);
19648 __tmp.put_u16_le(self.message_id);
19649 if matches!(version, MavlinkVersion::V2) {
19650 let len = __tmp.len();
19651 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19652 } else {
19653 __tmp.len()
19654 }
19655 }
19656}
19657#[doc = "id: 47"]
19658#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19659#[derive(Debug, Clone, PartialEq)]
19660#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19661#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19662pub struct MISSION_ACK_DATA {
19663 #[doc = "System ID"]
19664 pub target_system: u8,
19665 #[doc = "Component ID"]
19666 pub target_component: u8,
19667 #[doc = "Mission result."]
19668 pub mavtype: MavMissionResult,
19669 #[doc = "Mission type."]
19670 #[cfg_attr(feature = "serde", serde(default))]
19671 pub mission_type: MavMissionType,
19672 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19673 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19674 pub opaque_id: u32,
19675}
19676impl MISSION_ACK_DATA {
19677 pub const ENCODED_LEN: usize = 8usize;
19678 pub const DEFAULT: Self = Self {
19679 target_system: 0_u8,
19680 target_component: 0_u8,
19681 mavtype: MavMissionResult::DEFAULT,
19682 mission_type: MavMissionType::DEFAULT,
19683 opaque_id: 0_u32,
19684 };
19685 #[cfg(feature = "arbitrary")]
19686 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19687 use arbitrary::{Arbitrary, Unstructured};
19688 let mut buf = [0u8; 1024];
19689 rng.fill_bytes(&mut buf);
19690 let mut unstructured = Unstructured::new(&buf);
19691 Self::arbitrary(&mut unstructured).unwrap_or_default()
19692 }
19693}
19694impl Default for MISSION_ACK_DATA {
19695 fn default() -> Self {
19696 Self::DEFAULT.clone()
19697 }
19698}
19699impl MessageData for MISSION_ACK_DATA {
19700 type Message = MavMessage;
19701 const ID: u32 = 47u32;
19702 const NAME: &'static str = "MISSION_ACK";
19703 const EXTRA_CRC: u8 = 153u8;
19704 const ENCODED_LEN: usize = 8usize;
19705 fn deser(
19706 _version: MavlinkVersion,
19707 __input: &[u8],
19708 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19709 let avail_len = __input.len();
19710 let mut payload_buf = [0; Self::ENCODED_LEN];
19711 let mut buf = if avail_len < Self::ENCODED_LEN {
19712 payload_buf[0..avail_len].copy_from_slice(__input);
19713 Bytes::new(&payload_buf)
19714 } else {
19715 Bytes::new(__input)
19716 };
19717 let mut __struct = Self::default();
19718 __struct.target_system = buf.get_u8();
19719 __struct.target_component = buf.get_u8();
19720 let tmp = buf.get_u8();
19721 __struct.mavtype =
19722 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19723 enum_type: "MavMissionResult",
19724 value: tmp as u32,
19725 })?;
19726 let tmp = buf.get_u8();
19727 __struct.mission_type =
19728 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19729 enum_type: "MavMissionType",
19730 value: tmp as u32,
19731 })?;
19732 __struct.opaque_id = buf.get_u32_le();
19733 Ok(__struct)
19734 }
19735 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19736 let mut __tmp = BytesMut::new(bytes);
19737 #[allow(clippy::absurd_extreme_comparisons)]
19738 #[allow(unused_comparisons)]
19739 if __tmp.remaining() < Self::ENCODED_LEN {
19740 panic!(
19741 "buffer is too small (need {} bytes, but got {})",
19742 Self::ENCODED_LEN,
19743 __tmp.remaining(),
19744 )
19745 }
19746 __tmp.put_u8(self.target_system);
19747 __tmp.put_u8(self.target_component);
19748 __tmp.put_u8(self.mavtype as u8);
19749 __tmp.put_u8(self.mission_type as u8);
19750 __tmp.put_u32_le(self.opaque_id);
19751 if matches!(version, MavlinkVersion::V2) {
19752 let len = __tmp.len();
19753 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19754 } else {
19755 __tmp.len()
19756 }
19757 }
19758}
19759#[doc = "id: 45"]
19760#[doc = "Delete all mission items at once."]
19761#[derive(Debug, Clone, PartialEq)]
19762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19764pub struct MISSION_CLEAR_ALL_DATA {
19765 #[doc = "System ID"]
19766 pub target_system: u8,
19767 #[doc = "Component ID"]
19768 pub target_component: u8,
19769 #[doc = "Mission type."]
19770 #[cfg_attr(feature = "serde", serde(default))]
19771 pub mission_type: MavMissionType,
19772}
19773impl MISSION_CLEAR_ALL_DATA {
19774 pub const ENCODED_LEN: usize = 3usize;
19775 pub const DEFAULT: Self = Self {
19776 target_system: 0_u8,
19777 target_component: 0_u8,
19778 mission_type: MavMissionType::DEFAULT,
19779 };
19780 #[cfg(feature = "arbitrary")]
19781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19782 use arbitrary::{Arbitrary, Unstructured};
19783 let mut buf = [0u8; 1024];
19784 rng.fill_bytes(&mut buf);
19785 let mut unstructured = Unstructured::new(&buf);
19786 Self::arbitrary(&mut unstructured).unwrap_or_default()
19787 }
19788}
19789impl Default for MISSION_CLEAR_ALL_DATA {
19790 fn default() -> Self {
19791 Self::DEFAULT.clone()
19792 }
19793}
19794impl MessageData for MISSION_CLEAR_ALL_DATA {
19795 type Message = MavMessage;
19796 const ID: u32 = 45u32;
19797 const NAME: &'static str = "MISSION_CLEAR_ALL";
19798 const EXTRA_CRC: u8 = 232u8;
19799 const ENCODED_LEN: usize = 3usize;
19800 fn deser(
19801 _version: MavlinkVersion,
19802 __input: &[u8],
19803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19804 let avail_len = __input.len();
19805 let mut payload_buf = [0; Self::ENCODED_LEN];
19806 let mut buf = if avail_len < Self::ENCODED_LEN {
19807 payload_buf[0..avail_len].copy_from_slice(__input);
19808 Bytes::new(&payload_buf)
19809 } else {
19810 Bytes::new(__input)
19811 };
19812 let mut __struct = Self::default();
19813 __struct.target_system = buf.get_u8();
19814 __struct.target_component = buf.get_u8();
19815 let tmp = buf.get_u8();
19816 __struct.mission_type =
19817 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19818 enum_type: "MavMissionType",
19819 value: tmp as u32,
19820 })?;
19821 Ok(__struct)
19822 }
19823 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19824 let mut __tmp = BytesMut::new(bytes);
19825 #[allow(clippy::absurd_extreme_comparisons)]
19826 #[allow(unused_comparisons)]
19827 if __tmp.remaining() < Self::ENCODED_LEN {
19828 panic!(
19829 "buffer is too small (need {} bytes, but got {})",
19830 Self::ENCODED_LEN,
19831 __tmp.remaining(),
19832 )
19833 }
19834 __tmp.put_u8(self.target_system);
19835 __tmp.put_u8(self.target_component);
19836 __tmp.put_u8(self.mission_type as u8);
19837 if matches!(version, MavlinkVersion::V2) {
19838 let len = __tmp.len();
19839 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19840 } else {
19841 __tmp.len()
19842 }
19843 }
19844}
19845#[doc = "id: 44"]
19846#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19847#[derive(Debug, Clone, PartialEq)]
19848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19849#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19850pub struct MISSION_COUNT_DATA {
19851 #[doc = "Number of mission items in the sequence"]
19852 pub count: u16,
19853 #[doc = "System ID"]
19854 pub target_system: u8,
19855 #[doc = "Component ID"]
19856 pub target_component: u8,
19857 #[doc = "Mission type."]
19858 #[cfg_attr(feature = "serde", serde(default))]
19859 pub mission_type: MavMissionType,
19860 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19861 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19862 pub opaque_id: u32,
19863}
19864impl MISSION_COUNT_DATA {
19865 pub const ENCODED_LEN: usize = 9usize;
19866 pub const DEFAULT: Self = Self {
19867 count: 0_u16,
19868 target_system: 0_u8,
19869 target_component: 0_u8,
19870 mission_type: MavMissionType::DEFAULT,
19871 opaque_id: 0_u32,
19872 };
19873 #[cfg(feature = "arbitrary")]
19874 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19875 use arbitrary::{Arbitrary, Unstructured};
19876 let mut buf = [0u8; 1024];
19877 rng.fill_bytes(&mut buf);
19878 let mut unstructured = Unstructured::new(&buf);
19879 Self::arbitrary(&mut unstructured).unwrap_or_default()
19880 }
19881}
19882impl Default for MISSION_COUNT_DATA {
19883 fn default() -> Self {
19884 Self::DEFAULT.clone()
19885 }
19886}
19887impl MessageData for MISSION_COUNT_DATA {
19888 type Message = MavMessage;
19889 const ID: u32 = 44u32;
19890 const NAME: &'static str = "MISSION_COUNT";
19891 const EXTRA_CRC: u8 = 221u8;
19892 const ENCODED_LEN: usize = 9usize;
19893 fn deser(
19894 _version: MavlinkVersion,
19895 __input: &[u8],
19896 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19897 let avail_len = __input.len();
19898 let mut payload_buf = [0; Self::ENCODED_LEN];
19899 let mut buf = if avail_len < Self::ENCODED_LEN {
19900 payload_buf[0..avail_len].copy_from_slice(__input);
19901 Bytes::new(&payload_buf)
19902 } else {
19903 Bytes::new(__input)
19904 };
19905 let mut __struct = Self::default();
19906 __struct.count = buf.get_u16_le();
19907 __struct.target_system = buf.get_u8();
19908 __struct.target_component = buf.get_u8();
19909 let tmp = buf.get_u8();
19910 __struct.mission_type =
19911 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19912 enum_type: "MavMissionType",
19913 value: tmp as u32,
19914 })?;
19915 __struct.opaque_id = buf.get_u32_le();
19916 Ok(__struct)
19917 }
19918 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19919 let mut __tmp = BytesMut::new(bytes);
19920 #[allow(clippy::absurd_extreme_comparisons)]
19921 #[allow(unused_comparisons)]
19922 if __tmp.remaining() < Self::ENCODED_LEN {
19923 panic!(
19924 "buffer is too small (need {} bytes, but got {})",
19925 Self::ENCODED_LEN,
19926 __tmp.remaining(),
19927 )
19928 }
19929 __tmp.put_u16_le(self.count);
19930 __tmp.put_u8(self.target_system);
19931 __tmp.put_u8(self.target_component);
19932 __tmp.put_u8(self.mission_type as u8);
19933 __tmp.put_u32_le(self.opaque_id);
19934 if matches!(version, MavlinkVersion::V2) {
19935 let len = __tmp.len();
19936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19937 } else {
19938 __tmp.len()
19939 }
19940 }
19941}
19942#[doc = "id: 42"]
19943#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19944#[derive(Debug, Clone, PartialEq)]
19945#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19947pub struct MISSION_CURRENT_DATA {
19948 #[doc = "Sequence"]
19949 pub seq: u16,
19950 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19951 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19952 pub total: u16,
19953 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19954 #[cfg_attr(feature = "serde", serde(default))]
19955 pub mission_state: MissionState,
19956 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19957 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19958 pub mission_mode: u8,
19959 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19960 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19961 pub mission_id: u32,
19962 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19963 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19964 pub fence_id: u32,
19965 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19966 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19967 pub rally_points_id: u32,
19968}
19969impl MISSION_CURRENT_DATA {
19970 pub const ENCODED_LEN: usize = 18usize;
19971 pub const DEFAULT: Self = Self {
19972 seq: 0_u16,
19973 total: 0_u16,
19974 mission_state: MissionState::DEFAULT,
19975 mission_mode: 0_u8,
19976 mission_id: 0_u32,
19977 fence_id: 0_u32,
19978 rally_points_id: 0_u32,
19979 };
19980 #[cfg(feature = "arbitrary")]
19981 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19982 use arbitrary::{Arbitrary, Unstructured};
19983 let mut buf = [0u8; 1024];
19984 rng.fill_bytes(&mut buf);
19985 let mut unstructured = Unstructured::new(&buf);
19986 Self::arbitrary(&mut unstructured).unwrap_or_default()
19987 }
19988}
19989impl Default for MISSION_CURRENT_DATA {
19990 fn default() -> Self {
19991 Self::DEFAULT.clone()
19992 }
19993}
19994impl MessageData for MISSION_CURRENT_DATA {
19995 type Message = MavMessage;
19996 const ID: u32 = 42u32;
19997 const NAME: &'static str = "MISSION_CURRENT";
19998 const EXTRA_CRC: u8 = 28u8;
19999 const ENCODED_LEN: usize = 18usize;
20000 fn deser(
20001 _version: MavlinkVersion,
20002 __input: &[u8],
20003 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20004 let avail_len = __input.len();
20005 let mut payload_buf = [0; Self::ENCODED_LEN];
20006 let mut buf = if avail_len < Self::ENCODED_LEN {
20007 payload_buf[0..avail_len].copy_from_slice(__input);
20008 Bytes::new(&payload_buf)
20009 } else {
20010 Bytes::new(__input)
20011 };
20012 let mut __struct = Self::default();
20013 __struct.seq = buf.get_u16_le();
20014 __struct.total = buf.get_u16_le();
20015 let tmp = buf.get_u8();
20016 __struct.mission_state =
20017 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20018 enum_type: "MissionState",
20019 value: tmp as u32,
20020 })?;
20021 __struct.mission_mode = buf.get_u8();
20022 __struct.mission_id = buf.get_u32_le();
20023 __struct.fence_id = buf.get_u32_le();
20024 __struct.rally_points_id = buf.get_u32_le();
20025 Ok(__struct)
20026 }
20027 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20028 let mut __tmp = BytesMut::new(bytes);
20029 #[allow(clippy::absurd_extreme_comparisons)]
20030 #[allow(unused_comparisons)]
20031 if __tmp.remaining() < Self::ENCODED_LEN {
20032 panic!(
20033 "buffer is too small (need {} bytes, but got {})",
20034 Self::ENCODED_LEN,
20035 __tmp.remaining(),
20036 )
20037 }
20038 __tmp.put_u16_le(self.seq);
20039 __tmp.put_u16_le(self.total);
20040 __tmp.put_u8(self.mission_state as u8);
20041 __tmp.put_u8(self.mission_mode);
20042 __tmp.put_u32_le(self.mission_id);
20043 __tmp.put_u32_le(self.fence_id);
20044 __tmp.put_u32_le(self.rally_points_id);
20045 if matches!(version, MavlinkVersion::V2) {
20046 let len = __tmp.len();
20047 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20048 } else {
20049 __tmp.len()
20050 }
20051 }
20052}
20053#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
20054#[doc = "id: 39"]
20055#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20056#[derive(Debug, Clone, PartialEq)]
20057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20059pub struct MISSION_ITEM_DATA {
20060 #[doc = "PARAM1, see MAV_CMD enum"]
20061 pub param1: f32,
20062 #[doc = "PARAM2, see MAV_CMD enum"]
20063 pub param2: f32,
20064 #[doc = "PARAM3, see MAV_CMD enum"]
20065 pub param3: f32,
20066 #[doc = "PARAM4, see MAV_CMD enum"]
20067 pub param4: f32,
20068 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
20069 pub x: f32,
20070 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
20071 pub y: f32,
20072 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
20073 pub z: f32,
20074 #[doc = "Sequence"]
20075 pub seq: u16,
20076 #[doc = "The scheduled action for the waypoint."]
20077 pub command: MavCmd,
20078 #[doc = "System ID"]
20079 pub target_system: u8,
20080 #[doc = "Component ID"]
20081 pub target_component: u8,
20082 #[doc = "The coordinate system of the waypoint."]
20083 pub frame: MavFrame,
20084 #[doc = "false:0, true:1"]
20085 pub current: u8,
20086 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20087 pub autocontinue: u8,
20088 #[doc = "Mission type."]
20089 #[cfg_attr(feature = "serde", serde(default))]
20090 pub mission_type: MavMissionType,
20091}
20092impl MISSION_ITEM_DATA {
20093 pub const ENCODED_LEN: usize = 38usize;
20094 pub const DEFAULT: Self = Self {
20095 param1: 0.0_f32,
20096 param2: 0.0_f32,
20097 param3: 0.0_f32,
20098 param4: 0.0_f32,
20099 x: 0.0_f32,
20100 y: 0.0_f32,
20101 z: 0.0_f32,
20102 seq: 0_u16,
20103 command: MavCmd::DEFAULT,
20104 target_system: 0_u8,
20105 target_component: 0_u8,
20106 frame: MavFrame::DEFAULT,
20107 current: 0_u8,
20108 autocontinue: 0_u8,
20109 mission_type: MavMissionType::DEFAULT,
20110 };
20111 #[cfg(feature = "arbitrary")]
20112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20113 use arbitrary::{Arbitrary, Unstructured};
20114 let mut buf = [0u8; 1024];
20115 rng.fill_bytes(&mut buf);
20116 let mut unstructured = Unstructured::new(&buf);
20117 Self::arbitrary(&mut unstructured).unwrap_or_default()
20118 }
20119}
20120impl Default for MISSION_ITEM_DATA {
20121 fn default() -> Self {
20122 Self::DEFAULT.clone()
20123 }
20124}
20125impl MessageData for MISSION_ITEM_DATA {
20126 type Message = MavMessage;
20127 const ID: u32 = 39u32;
20128 const NAME: &'static str = "MISSION_ITEM";
20129 const EXTRA_CRC: u8 = 254u8;
20130 const ENCODED_LEN: usize = 38usize;
20131 fn deser(
20132 _version: MavlinkVersion,
20133 __input: &[u8],
20134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20135 let avail_len = __input.len();
20136 let mut payload_buf = [0; Self::ENCODED_LEN];
20137 let mut buf = if avail_len < Self::ENCODED_LEN {
20138 payload_buf[0..avail_len].copy_from_slice(__input);
20139 Bytes::new(&payload_buf)
20140 } else {
20141 Bytes::new(__input)
20142 };
20143 let mut __struct = Self::default();
20144 __struct.param1 = buf.get_f32_le();
20145 __struct.param2 = buf.get_f32_le();
20146 __struct.param3 = buf.get_f32_le();
20147 __struct.param4 = buf.get_f32_le();
20148 __struct.x = buf.get_f32_le();
20149 __struct.y = buf.get_f32_le();
20150 __struct.z = buf.get_f32_le();
20151 __struct.seq = buf.get_u16_le();
20152 let tmp = buf.get_u16_le();
20153 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20154 ::mavlink_core::error::ParserError::InvalidEnum {
20155 enum_type: "MavCmd",
20156 value: tmp as u32,
20157 },
20158 )?;
20159 __struct.target_system = buf.get_u8();
20160 __struct.target_component = buf.get_u8();
20161 let tmp = buf.get_u8();
20162 __struct.frame =
20163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20164 enum_type: "MavFrame",
20165 value: tmp as u32,
20166 })?;
20167 __struct.current = buf.get_u8();
20168 __struct.autocontinue = buf.get_u8();
20169 let tmp = buf.get_u8();
20170 __struct.mission_type =
20171 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20172 enum_type: "MavMissionType",
20173 value: tmp as u32,
20174 })?;
20175 Ok(__struct)
20176 }
20177 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20178 let mut __tmp = BytesMut::new(bytes);
20179 #[allow(clippy::absurd_extreme_comparisons)]
20180 #[allow(unused_comparisons)]
20181 if __tmp.remaining() < Self::ENCODED_LEN {
20182 panic!(
20183 "buffer is too small (need {} bytes, but got {})",
20184 Self::ENCODED_LEN,
20185 __tmp.remaining(),
20186 )
20187 }
20188 __tmp.put_f32_le(self.param1);
20189 __tmp.put_f32_le(self.param2);
20190 __tmp.put_f32_le(self.param3);
20191 __tmp.put_f32_le(self.param4);
20192 __tmp.put_f32_le(self.x);
20193 __tmp.put_f32_le(self.y);
20194 __tmp.put_f32_le(self.z);
20195 __tmp.put_u16_le(self.seq);
20196 __tmp.put_u16_le(self.command as u16);
20197 __tmp.put_u8(self.target_system);
20198 __tmp.put_u8(self.target_component);
20199 __tmp.put_u8(self.frame as u8);
20200 __tmp.put_u8(self.current);
20201 __tmp.put_u8(self.autocontinue);
20202 __tmp.put_u8(self.mission_type as u8);
20203 if matches!(version, MavlinkVersion::V2) {
20204 let len = __tmp.len();
20205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20206 } else {
20207 __tmp.len()
20208 }
20209 }
20210}
20211#[doc = "id: 73"]
20212#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20213#[derive(Debug, Clone, PartialEq)]
20214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20216pub struct MISSION_ITEM_INT_DATA {
20217 #[doc = "PARAM1, see MAV_CMD enum"]
20218 pub param1: f32,
20219 #[doc = "PARAM2, see MAV_CMD enum"]
20220 pub param2: f32,
20221 #[doc = "PARAM3, see MAV_CMD enum"]
20222 pub param3: f32,
20223 #[doc = "PARAM4, see MAV_CMD enum"]
20224 pub param4: f32,
20225 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20226 pub x: i32,
20227 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20228 pub y: i32,
20229 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20230 pub z: f32,
20231 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20232 pub seq: u16,
20233 #[doc = "The scheduled action for the waypoint."]
20234 pub command: MavCmd,
20235 #[doc = "System ID"]
20236 pub target_system: u8,
20237 #[doc = "Component ID"]
20238 pub target_component: u8,
20239 #[doc = "The coordinate system of the waypoint."]
20240 pub frame: MavFrame,
20241 #[doc = "false:0, true:1"]
20242 pub current: u8,
20243 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20244 pub autocontinue: u8,
20245 #[doc = "Mission type."]
20246 #[cfg_attr(feature = "serde", serde(default))]
20247 pub mission_type: MavMissionType,
20248}
20249impl MISSION_ITEM_INT_DATA {
20250 pub const ENCODED_LEN: usize = 38usize;
20251 pub const DEFAULT: Self = Self {
20252 param1: 0.0_f32,
20253 param2: 0.0_f32,
20254 param3: 0.0_f32,
20255 param4: 0.0_f32,
20256 x: 0_i32,
20257 y: 0_i32,
20258 z: 0.0_f32,
20259 seq: 0_u16,
20260 command: MavCmd::DEFAULT,
20261 target_system: 0_u8,
20262 target_component: 0_u8,
20263 frame: MavFrame::DEFAULT,
20264 current: 0_u8,
20265 autocontinue: 0_u8,
20266 mission_type: MavMissionType::DEFAULT,
20267 };
20268 #[cfg(feature = "arbitrary")]
20269 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20270 use arbitrary::{Arbitrary, Unstructured};
20271 let mut buf = [0u8; 1024];
20272 rng.fill_bytes(&mut buf);
20273 let mut unstructured = Unstructured::new(&buf);
20274 Self::arbitrary(&mut unstructured).unwrap_or_default()
20275 }
20276}
20277impl Default for MISSION_ITEM_INT_DATA {
20278 fn default() -> Self {
20279 Self::DEFAULT.clone()
20280 }
20281}
20282impl MessageData for MISSION_ITEM_INT_DATA {
20283 type Message = MavMessage;
20284 const ID: u32 = 73u32;
20285 const NAME: &'static str = "MISSION_ITEM_INT";
20286 const EXTRA_CRC: u8 = 38u8;
20287 const ENCODED_LEN: usize = 38usize;
20288 fn deser(
20289 _version: MavlinkVersion,
20290 __input: &[u8],
20291 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20292 let avail_len = __input.len();
20293 let mut payload_buf = [0; Self::ENCODED_LEN];
20294 let mut buf = if avail_len < Self::ENCODED_LEN {
20295 payload_buf[0..avail_len].copy_from_slice(__input);
20296 Bytes::new(&payload_buf)
20297 } else {
20298 Bytes::new(__input)
20299 };
20300 let mut __struct = Self::default();
20301 __struct.param1 = buf.get_f32_le();
20302 __struct.param2 = buf.get_f32_le();
20303 __struct.param3 = buf.get_f32_le();
20304 __struct.param4 = buf.get_f32_le();
20305 __struct.x = buf.get_i32_le();
20306 __struct.y = buf.get_i32_le();
20307 __struct.z = buf.get_f32_le();
20308 __struct.seq = buf.get_u16_le();
20309 let tmp = buf.get_u16_le();
20310 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20311 ::mavlink_core::error::ParserError::InvalidEnum {
20312 enum_type: "MavCmd",
20313 value: tmp as u32,
20314 },
20315 )?;
20316 __struct.target_system = buf.get_u8();
20317 __struct.target_component = buf.get_u8();
20318 let tmp = buf.get_u8();
20319 __struct.frame =
20320 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20321 enum_type: "MavFrame",
20322 value: tmp as u32,
20323 })?;
20324 __struct.current = buf.get_u8();
20325 __struct.autocontinue = buf.get_u8();
20326 let tmp = buf.get_u8();
20327 __struct.mission_type =
20328 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20329 enum_type: "MavMissionType",
20330 value: tmp as u32,
20331 })?;
20332 Ok(__struct)
20333 }
20334 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20335 let mut __tmp = BytesMut::new(bytes);
20336 #[allow(clippy::absurd_extreme_comparisons)]
20337 #[allow(unused_comparisons)]
20338 if __tmp.remaining() < Self::ENCODED_LEN {
20339 panic!(
20340 "buffer is too small (need {} bytes, but got {})",
20341 Self::ENCODED_LEN,
20342 __tmp.remaining(),
20343 )
20344 }
20345 __tmp.put_f32_le(self.param1);
20346 __tmp.put_f32_le(self.param2);
20347 __tmp.put_f32_le(self.param3);
20348 __tmp.put_f32_le(self.param4);
20349 __tmp.put_i32_le(self.x);
20350 __tmp.put_i32_le(self.y);
20351 __tmp.put_f32_le(self.z);
20352 __tmp.put_u16_le(self.seq);
20353 __tmp.put_u16_le(self.command as u16);
20354 __tmp.put_u8(self.target_system);
20355 __tmp.put_u8(self.target_component);
20356 __tmp.put_u8(self.frame as u8);
20357 __tmp.put_u8(self.current);
20358 __tmp.put_u8(self.autocontinue);
20359 __tmp.put_u8(self.mission_type as u8);
20360 if matches!(version, MavlinkVersion::V2) {
20361 let len = __tmp.len();
20362 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20363 } else {
20364 __tmp.len()
20365 }
20366 }
20367}
20368#[doc = "id: 46"]
20369#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20370#[derive(Debug, Clone, PartialEq)]
20371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20373pub struct MISSION_ITEM_REACHED_DATA {
20374 #[doc = "Sequence"]
20375 pub seq: u16,
20376}
20377impl MISSION_ITEM_REACHED_DATA {
20378 pub const ENCODED_LEN: usize = 2usize;
20379 pub const DEFAULT: Self = Self { seq: 0_u16 };
20380 #[cfg(feature = "arbitrary")]
20381 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20382 use arbitrary::{Arbitrary, Unstructured};
20383 let mut buf = [0u8; 1024];
20384 rng.fill_bytes(&mut buf);
20385 let mut unstructured = Unstructured::new(&buf);
20386 Self::arbitrary(&mut unstructured).unwrap_or_default()
20387 }
20388}
20389impl Default for MISSION_ITEM_REACHED_DATA {
20390 fn default() -> Self {
20391 Self::DEFAULT.clone()
20392 }
20393}
20394impl MessageData for MISSION_ITEM_REACHED_DATA {
20395 type Message = MavMessage;
20396 const ID: u32 = 46u32;
20397 const NAME: &'static str = "MISSION_ITEM_REACHED";
20398 const EXTRA_CRC: u8 = 11u8;
20399 const ENCODED_LEN: usize = 2usize;
20400 fn deser(
20401 _version: MavlinkVersion,
20402 __input: &[u8],
20403 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20404 let avail_len = __input.len();
20405 let mut payload_buf = [0; Self::ENCODED_LEN];
20406 let mut buf = if avail_len < Self::ENCODED_LEN {
20407 payload_buf[0..avail_len].copy_from_slice(__input);
20408 Bytes::new(&payload_buf)
20409 } else {
20410 Bytes::new(__input)
20411 };
20412 let mut __struct = Self::default();
20413 __struct.seq = buf.get_u16_le();
20414 Ok(__struct)
20415 }
20416 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20417 let mut __tmp = BytesMut::new(bytes);
20418 #[allow(clippy::absurd_extreme_comparisons)]
20419 #[allow(unused_comparisons)]
20420 if __tmp.remaining() < Self::ENCODED_LEN {
20421 panic!(
20422 "buffer is too small (need {} bytes, but got {})",
20423 Self::ENCODED_LEN,
20424 __tmp.remaining(),
20425 )
20426 }
20427 __tmp.put_u16_le(self.seq);
20428 if matches!(version, MavlinkVersion::V2) {
20429 let len = __tmp.len();
20430 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20431 } else {
20432 __tmp.len()
20433 }
20434 }
20435}
20436#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20437#[doc = "id: 40"]
20438#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20439#[derive(Debug, Clone, PartialEq)]
20440#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20441#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20442pub struct MISSION_REQUEST_DATA {
20443 #[doc = "Sequence"]
20444 pub seq: u16,
20445 #[doc = "System ID"]
20446 pub target_system: u8,
20447 #[doc = "Component ID"]
20448 pub target_component: u8,
20449 #[doc = "Mission type."]
20450 #[cfg_attr(feature = "serde", serde(default))]
20451 pub mission_type: MavMissionType,
20452}
20453impl MISSION_REQUEST_DATA {
20454 pub const ENCODED_LEN: usize = 5usize;
20455 pub const DEFAULT: Self = Self {
20456 seq: 0_u16,
20457 target_system: 0_u8,
20458 target_component: 0_u8,
20459 mission_type: MavMissionType::DEFAULT,
20460 };
20461 #[cfg(feature = "arbitrary")]
20462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20463 use arbitrary::{Arbitrary, Unstructured};
20464 let mut buf = [0u8; 1024];
20465 rng.fill_bytes(&mut buf);
20466 let mut unstructured = Unstructured::new(&buf);
20467 Self::arbitrary(&mut unstructured).unwrap_or_default()
20468 }
20469}
20470impl Default for MISSION_REQUEST_DATA {
20471 fn default() -> Self {
20472 Self::DEFAULT.clone()
20473 }
20474}
20475impl MessageData for MISSION_REQUEST_DATA {
20476 type Message = MavMessage;
20477 const ID: u32 = 40u32;
20478 const NAME: &'static str = "MISSION_REQUEST";
20479 const EXTRA_CRC: u8 = 230u8;
20480 const ENCODED_LEN: usize = 5usize;
20481 fn deser(
20482 _version: MavlinkVersion,
20483 __input: &[u8],
20484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20485 let avail_len = __input.len();
20486 let mut payload_buf = [0; Self::ENCODED_LEN];
20487 let mut buf = if avail_len < Self::ENCODED_LEN {
20488 payload_buf[0..avail_len].copy_from_slice(__input);
20489 Bytes::new(&payload_buf)
20490 } else {
20491 Bytes::new(__input)
20492 };
20493 let mut __struct = Self::default();
20494 __struct.seq = buf.get_u16_le();
20495 __struct.target_system = buf.get_u8();
20496 __struct.target_component = buf.get_u8();
20497 let tmp = buf.get_u8();
20498 __struct.mission_type =
20499 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20500 enum_type: "MavMissionType",
20501 value: tmp as u32,
20502 })?;
20503 Ok(__struct)
20504 }
20505 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20506 let mut __tmp = BytesMut::new(bytes);
20507 #[allow(clippy::absurd_extreme_comparisons)]
20508 #[allow(unused_comparisons)]
20509 if __tmp.remaining() < Self::ENCODED_LEN {
20510 panic!(
20511 "buffer is too small (need {} bytes, but got {})",
20512 Self::ENCODED_LEN,
20513 __tmp.remaining(),
20514 )
20515 }
20516 __tmp.put_u16_le(self.seq);
20517 __tmp.put_u8(self.target_system);
20518 __tmp.put_u8(self.target_component);
20519 __tmp.put_u8(self.mission_type as u8);
20520 if matches!(version, MavlinkVersion::V2) {
20521 let len = __tmp.len();
20522 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20523 } else {
20524 __tmp.len()
20525 }
20526 }
20527}
20528#[doc = "id: 51"]
20529#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20530#[derive(Debug, Clone, PartialEq)]
20531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20533pub struct MISSION_REQUEST_INT_DATA {
20534 #[doc = "Sequence"]
20535 pub seq: u16,
20536 #[doc = "System ID"]
20537 pub target_system: u8,
20538 #[doc = "Component ID"]
20539 pub target_component: u8,
20540 #[doc = "Mission type."]
20541 #[cfg_attr(feature = "serde", serde(default))]
20542 pub mission_type: MavMissionType,
20543}
20544impl MISSION_REQUEST_INT_DATA {
20545 pub const ENCODED_LEN: usize = 5usize;
20546 pub const DEFAULT: Self = Self {
20547 seq: 0_u16,
20548 target_system: 0_u8,
20549 target_component: 0_u8,
20550 mission_type: MavMissionType::DEFAULT,
20551 };
20552 #[cfg(feature = "arbitrary")]
20553 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20554 use arbitrary::{Arbitrary, Unstructured};
20555 let mut buf = [0u8; 1024];
20556 rng.fill_bytes(&mut buf);
20557 let mut unstructured = Unstructured::new(&buf);
20558 Self::arbitrary(&mut unstructured).unwrap_or_default()
20559 }
20560}
20561impl Default for MISSION_REQUEST_INT_DATA {
20562 fn default() -> Self {
20563 Self::DEFAULT.clone()
20564 }
20565}
20566impl MessageData for MISSION_REQUEST_INT_DATA {
20567 type Message = MavMessage;
20568 const ID: u32 = 51u32;
20569 const NAME: &'static str = "MISSION_REQUEST_INT";
20570 const EXTRA_CRC: u8 = 196u8;
20571 const ENCODED_LEN: usize = 5usize;
20572 fn deser(
20573 _version: MavlinkVersion,
20574 __input: &[u8],
20575 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20576 let avail_len = __input.len();
20577 let mut payload_buf = [0; Self::ENCODED_LEN];
20578 let mut buf = if avail_len < Self::ENCODED_LEN {
20579 payload_buf[0..avail_len].copy_from_slice(__input);
20580 Bytes::new(&payload_buf)
20581 } else {
20582 Bytes::new(__input)
20583 };
20584 let mut __struct = Self::default();
20585 __struct.seq = buf.get_u16_le();
20586 __struct.target_system = buf.get_u8();
20587 __struct.target_component = buf.get_u8();
20588 let tmp = buf.get_u8();
20589 __struct.mission_type =
20590 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20591 enum_type: "MavMissionType",
20592 value: tmp as u32,
20593 })?;
20594 Ok(__struct)
20595 }
20596 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20597 let mut __tmp = BytesMut::new(bytes);
20598 #[allow(clippy::absurd_extreme_comparisons)]
20599 #[allow(unused_comparisons)]
20600 if __tmp.remaining() < Self::ENCODED_LEN {
20601 panic!(
20602 "buffer is too small (need {} bytes, but got {})",
20603 Self::ENCODED_LEN,
20604 __tmp.remaining(),
20605 )
20606 }
20607 __tmp.put_u16_le(self.seq);
20608 __tmp.put_u8(self.target_system);
20609 __tmp.put_u8(self.target_component);
20610 __tmp.put_u8(self.mission_type as u8);
20611 if matches!(version, MavlinkVersion::V2) {
20612 let len = __tmp.len();
20613 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20614 } else {
20615 __tmp.len()
20616 }
20617 }
20618}
20619#[doc = "id: 43"]
20620#[doc = "Request the overall list of mission items from the system/component."]
20621#[derive(Debug, Clone, PartialEq)]
20622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20623#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20624pub struct MISSION_REQUEST_LIST_DATA {
20625 #[doc = "System ID"]
20626 pub target_system: u8,
20627 #[doc = "Component ID"]
20628 pub target_component: u8,
20629 #[doc = "Mission type."]
20630 #[cfg_attr(feature = "serde", serde(default))]
20631 pub mission_type: MavMissionType,
20632}
20633impl MISSION_REQUEST_LIST_DATA {
20634 pub const ENCODED_LEN: usize = 3usize;
20635 pub const DEFAULT: Self = Self {
20636 target_system: 0_u8,
20637 target_component: 0_u8,
20638 mission_type: MavMissionType::DEFAULT,
20639 };
20640 #[cfg(feature = "arbitrary")]
20641 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20642 use arbitrary::{Arbitrary, Unstructured};
20643 let mut buf = [0u8; 1024];
20644 rng.fill_bytes(&mut buf);
20645 let mut unstructured = Unstructured::new(&buf);
20646 Self::arbitrary(&mut unstructured).unwrap_or_default()
20647 }
20648}
20649impl Default for MISSION_REQUEST_LIST_DATA {
20650 fn default() -> Self {
20651 Self::DEFAULT.clone()
20652 }
20653}
20654impl MessageData for MISSION_REQUEST_LIST_DATA {
20655 type Message = MavMessage;
20656 const ID: u32 = 43u32;
20657 const NAME: &'static str = "MISSION_REQUEST_LIST";
20658 const EXTRA_CRC: u8 = 132u8;
20659 const ENCODED_LEN: usize = 3usize;
20660 fn deser(
20661 _version: MavlinkVersion,
20662 __input: &[u8],
20663 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20664 let avail_len = __input.len();
20665 let mut payload_buf = [0; Self::ENCODED_LEN];
20666 let mut buf = if avail_len < Self::ENCODED_LEN {
20667 payload_buf[0..avail_len].copy_from_slice(__input);
20668 Bytes::new(&payload_buf)
20669 } else {
20670 Bytes::new(__input)
20671 };
20672 let mut __struct = Self::default();
20673 __struct.target_system = buf.get_u8();
20674 __struct.target_component = buf.get_u8();
20675 let tmp = buf.get_u8();
20676 __struct.mission_type =
20677 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20678 enum_type: "MavMissionType",
20679 value: tmp as u32,
20680 })?;
20681 Ok(__struct)
20682 }
20683 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20684 let mut __tmp = BytesMut::new(bytes);
20685 #[allow(clippy::absurd_extreme_comparisons)]
20686 #[allow(unused_comparisons)]
20687 if __tmp.remaining() < Self::ENCODED_LEN {
20688 panic!(
20689 "buffer is too small (need {} bytes, but got {})",
20690 Self::ENCODED_LEN,
20691 __tmp.remaining(),
20692 )
20693 }
20694 __tmp.put_u8(self.target_system);
20695 __tmp.put_u8(self.target_component);
20696 __tmp.put_u8(self.mission_type as u8);
20697 if matches!(version, MavlinkVersion::V2) {
20698 let len = __tmp.len();
20699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20700 } else {
20701 __tmp.len()
20702 }
20703 }
20704}
20705#[doc = "id: 37"]
20706#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20707#[derive(Debug, Clone, PartialEq)]
20708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20710pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20711 #[doc = "Start index"]
20712 pub start_index: i16,
20713 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20714 pub end_index: i16,
20715 #[doc = "System ID"]
20716 pub target_system: u8,
20717 #[doc = "Component ID"]
20718 pub target_component: u8,
20719 #[doc = "Mission type."]
20720 #[cfg_attr(feature = "serde", serde(default))]
20721 pub mission_type: MavMissionType,
20722}
20723impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20724 pub const ENCODED_LEN: usize = 7usize;
20725 pub const DEFAULT: Self = Self {
20726 start_index: 0_i16,
20727 end_index: 0_i16,
20728 target_system: 0_u8,
20729 target_component: 0_u8,
20730 mission_type: MavMissionType::DEFAULT,
20731 };
20732 #[cfg(feature = "arbitrary")]
20733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20734 use arbitrary::{Arbitrary, Unstructured};
20735 let mut buf = [0u8; 1024];
20736 rng.fill_bytes(&mut buf);
20737 let mut unstructured = Unstructured::new(&buf);
20738 Self::arbitrary(&mut unstructured).unwrap_or_default()
20739 }
20740}
20741impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20742 fn default() -> Self {
20743 Self::DEFAULT.clone()
20744 }
20745}
20746impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20747 type Message = MavMessage;
20748 const ID: u32 = 37u32;
20749 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20750 const EXTRA_CRC: u8 = 212u8;
20751 const ENCODED_LEN: usize = 7usize;
20752 fn deser(
20753 _version: MavlinkVersion,
20754 __input: &[u8],
20755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20756 let avail_len = __input.len();
20757 let mut payload_buf = [0; Self::ENCODED_LEN];
20758 let mut buf = if avail_len < Self::ENCODED_LEN {
20759 payload_buf[0..avail_len].copy_from_slice(__input);
20760 Bytes::new(&payload_buf)
20761 } else {
20762 Bytes::new(__input)
20763 };
20764 let mut __struct = Self::default();
20765 __struct.start_index = buf.get_i16_le();
20766 __struct.end_index = buf.get_i16_le();
20767 __struct.target_system = buf.get_u8();
20768 __struct.target_component = buf.get_u8();
20769 let tmp = buf.get_u8();
20770 __struct.mission_type =
20771 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20772 enum_type: "MavMissionType",
20773 value: tmp as u32,
20774 })?;
20775 Ok(__struct)
20776 }
20777 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20778 let mut __tmp = BytesMut::new(bytes);
20779 #[allow(clippy::absurd_extreme_comparisons)]
20780 #[allow(unused_comparisons)]
20781 if __tmp.remaining() < Self::ENCODED_LEN {
20782 panic!(
20783 "buffer is too small (need {} bytes, but got {})",
20784 Self::ENCODED_LEN,
20785 __tmp.remaining(),
20786 )
20787 }
20788 __tmp.put_i16_le(self.start_index);
20789 __tmp.put_i16_le(self.end_index);
20790 __tmp.put_u8(self.target_system);
20791 __tmp.put_u8(self.target_component);
20792 __tmp.put_u8(self.mission_type as u8);
20793 if matches!(version, MavlinkVersion::V2) {
20794 let len = __tmp.len();
20795 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20796 } else {
20797 __tmp.len()
20798 }
20799 }
20800}
20801#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20802#[doc = "id: 41"]
20803#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20804#[derive(Debug, Clone, PartialEq)]
20805#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20806#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20807pub struct MISSION_SET_CURRENT_DATA {
20808 #[doc = "Sequence"]
20809 pub seq: u16,
20810 #[doc = "System ID"]
20811 pub target_system: u8,
20812 #[doc = "Component ID"]
20813 pub target_component: u8,
20814}
20815impl MISSION_SET_CURRENT_DATA {
20816 pub const ENCODED_LEN: usize = 4usize;
20817 pub const DEFAULT: Self = Self {
20818 seq: 0_u16,
20819 target_system: 0_u8,
20820 target_component: 0_u8,
20821 };
20822 #[cfg(feature = "arbitrary")]
20823 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20824 use arbitrary::{Arbitrary, Unstructured};
20825 let mut buf = [0u8; 1024];
20826 rng.fill_bytes(&mut buf);
20827 let mut unstructured = Unstructured::new(&buf);
20828 Self::arbitrary(&mut unstructured).unwrap_or_default()
20829 }
20830}
20831impl Default for MISSION_SET_CURRENT_DATA {
20832 fn default() -> Self {
20833 Self::DEFAULT.clone()
20834 }
20835}
20836impl MessageData for MISSION_SET_CURRENT_DATA {
20837 type Message = MavMessage;
20838 const ID: u32 = 41u32;
20839 const NAME: &'static str = "MISSION_SET_CURRENT";
20840 const EXTRA_CRC: u8 = 28u8;
20841 const ENCODED_LEN: usize = 4usize;
20842 fn deser(
20843 _version: MavlinkVersion,
20844 __input: &[u8],
20845 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20846 let avail_len = __input.len();
20847 let mut payload_buf = [0; Self::ENCODED_LEN];
20848 let mut buf = if avail_len < Self::ENCODED_LEN {
20849 payload_buf[0..avail_len].copy_from_slice(__input);
20850 Bytes::new(&payload_buf)
20851 } else {
20852 Bytes::new(__input)
20853 };
20854 let mut __struct = Self::default();
20855 __struct.seq = buf.get_u16_le();
20856 __struct.target_system = buf.get_u8();
20857 __struct.target_component = buf.get_u8();
20858 Ok(__struct)
20859 }
20860 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20861 let mut __tmp = BytesMut::new(bytes);
20862 #[allow(clippy::absurd_extreme_comparisons)]
20863 #[allow(unused_comparisons)]
20864 if __tmp.remaining() < Self::ENCODED_LEN {
20865 panic!(
20866 "buffer is too small (need {} bytes, but got {})",
20867 Self::ENCODED_LEN,
20868 __tmp.remaining(),
20869 )
20870 }
20871 __tmp.put_u16_le(self.seq);
20872 __tmp.put_u8(self.target_system);
20873 __tmp.put_u8(self.target_component);
20874 if matches!(version, MavlinkVersion::V2) {
20875 let len = __tmp.len();
20876 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20877 } else {
20878 __tmp.len()
20879 }
20880 }
20881}
20882#[doc = "id: 38"]
20883#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20884#[derive(Debug, Clone, PartialEq)]
20885#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20887pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20888 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20889 pub start_index: i16,
20890 #[doc = "End index, equal or greater than start index."]
20891 pub end_index: i16,
20892 #[doc = "System ID"]
20893 pub target_system: u8,
20894 #[doc = "Component ID"]
20895 pub target_component: u8,
20896 #[doc = "Mission type."]
20897 #[cfg_attr(feature = "serde", serde(default))]
20898 pub mission_type: MavMissionType,
20899}
20900impl MISSION_WRITE_PARTIAL_LIST_DATA {
20901 pub const ENCODED_LEN: usize = 7usize;
20902 pub const DEFAULT: Self = Self {
20903 start_index: 0_i16,
20904 end_index: 0_i16,
20905 target_system: 0_u8,
20906 target_component: 0_u8,
20907 mission_type: MavMissionType::DEFAULT,
20908 };
20909 #[cfg(feature = "arbitrary")]
20910 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20911 use arbitrary::{Arbitrary, Unstructured};
20912 let mut buf = [0u8; 1024];
20913 rng.fill_bytes(&mut buf);
20914 let mut unstructured = Unstructured::new(&buf);
20915 Self::arbitrary(&mut unstructured).unwrap_or_default()
20916 }
20917}
20918impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20919 fn default() -> Self {
20920 Self::DEFAULT.clone()
20921 }
20922}
20923impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20924 type Message = MavMessage;
20925 const ID: u32 = 38u32;
20926 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20927 const EXTRA_CRC: u8 = 9u8;
20928 const ENCODED_LEN: usize = 7usize;
20929 fn deser(
20930 _version: MavlinkVersion,
20931 __input: &[u8],
20932 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20933 let avail_len = __input.len();
20934 let mut payload_buf = [0; Self::ENCODED_LEN];
20935 let mut buf = if avail_len < Self::ENCODED_LEN {
20936 payload_buf[0..avail_len].copy_from_slice(__input);
20937 Bytes::new(&payload_buf)
20938 } else {
20939 Bytes::new(__input)
20940 };
20941 let mut __struct = Self::default();
20942 __struct.start_index = buf.get_i16_le();
20943 __struct.end_index = buf.get_i16_le();
20944 __struct.target_system = buf.get_u8();
20945 __struct.target_component = buf.get_u8();
20946 let tmp = buf.get_u8();
20947 __struct.mission_type =
20948 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20949 enum_type: "MavMissionType",
20950 value: tmp as u32,
20951 })?;
20952 Ok(__struct)
20953 }
20954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20955 let mut __tmp = BytesMut::new(bytes);
20956 #[allow(clippy::absurd_extreme_comparisons)]
20957 #[allow(unused_comparisons)]
20958 if __tmp.remaining() < Self::ENCODED_LEN {
20959 panic!(
20960 "buffer is too small (need {} bytes, but got {})",
20961 Self::ENCODED_LEN,
20962 __tmp.remaining(),
20963 )
20964 }
20965 __tmp.put_i16_le(self.start_index);
20966 __tmp.put_i16_le(self.end_index);
20967 __tmp.put_u8(self.target_system);
20968 __tmp.put_u8(self.target_component);
20969 __tmp.put_u8(self.mission_type as u8);
20970 if matches!(version, MavlinkVersion::V2) {
20971 let len = __tmp.len();
20972 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20973 } else {
20974 __tmp.len()
20975 }
20976 }
20977}
20978#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20979#[doc = "id: 265"]
20980#[doc = "Orientation of a mount."]
20981#[derive(Debug, Clone, PartialEq)]
20982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20984pub struct MOUNT_ORIENTATION_DATA {
20985 #[doc = "Timestamp (time since system boot)."]
20986 pub time_boot_ms: u32,
20987 #[doc = "Roll in global frame (set to NaN for invalid)."]
20988 pub roll: f32,
20989 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20990 pub pitch: f32,
20991 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20992 pub yaw: f32,
20993 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20994 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20995 pub yaw_absolute: f32,
20996}
20997impl MOUNT_ORIENTATION_DATA {
20998 pub const ENCODED_LEN: usize = 20usize;
20999 pub const DEFAULT: Self = Self {
21000 time_boot_ms: 0_u32,
21001 roll: 0.0_f32,
21002 pitch: 0.0_f32,
21003 yaw: 0.0_f32,
21004 yaw_absolute: 0.0_f32,
21005 };
21006 #[cfg(feature = "arbitrary")]
21007 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21008 use arbitrary::{Arbitrary, Unstructured};
21009 let mut buf = [0u8; 1024];
21010 rng.fill_bytes(&mut buf);
21011 let mut unstructured = Unstructured::new(&buf);
21012 Self::arbitrary(&mut unstructured).unwrap_or_default()
21013 }
21014}
21015impl Default for MOUNT_ORIENTATION_DATA {
21016 fn default() -> Self {
21017 Self::DEFAULT.clone()
21018 }
21019}
21020impl MessageData for MOUNT_ORIENTATION_DATA {
21021 type Message = MavMessage;
21022 const ID: u32 = 265u32;
21023 const NAME: &'static str = "MOUNT_ORIENTATION";
21024 const EXTRA_CRC: u8 = 26u8;
21025 const ENCODED_LEN: usize = 20usize;
21026 fn deser(
21027 _version: MavlinkVersion,
21028 __input: &[u8],
21029 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21030 let avail_len = __input.len();
21031 let mut payload_buf = [0; Self::ENCODED_LEN];
21032 let mut buf = if avail_len < Self::ENCODED_LEN {
21033 payload_buf[0..avail_len].copy_from_slice(__input);
21034 Bytes::new(&payload_buf)
21035 } else {
21036 Bytes::new(__input)
21037 };
21038 let mut __struct = Self::default();
21039 __struct.time_boot_ms = buf.get_u32_le();
21040 __struct.roll = buf.get_f32_le();
21041 __struct.pitch = buf.get_f32_le();
21042 __struct.yaw = buf.get_f32_le();
21043 __struct.yaw_absolute = buf.get_f32_le();
21044 Ok(__struct)
21045 }
21046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21047 let mut __tmp = BytesMut::new(bytes);
21048 #[allow(clippy::absurd_extreme_comparisons)]
21049 #[allow(unused_comparisons)]
21050 if __tmp.remaining() < Self::ENCODED_LEN {
21051 panic!(
21052 "buffer is too small (need {} bytes, but got {})",
21053 Self::ENCODED_LEN,
21054 __tmp.remaining(),
21055 )
21056 }
21057 __tmp.put_u32_le(self.time_boot_ms);
21058 __tmp.put_f32_le(self.roll);
21059 __tmp.put_f32_le(self.pitch);
21060 __tmp.put_f32_le(self.yaw);
21061 __tmp.put_f32_le(self.yaw_absolute);
21062 if matches!(version, MavlinkVersion::V2) {
21063 let len = __tmp.len();
21064 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21065 } else {
21066 __tmp.len()
21067 }
21068 }
21069}
21070#[doc = "id: 251"]
21071#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21072#[derive(Debug, Clone, PartialEq)]
21073#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21074#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21075pub struct NAMED_VALUE_FLOAT_DATA {
21076 #[doc = "Timestamp (time since system boot)."]
21077 pub time_boot_ms: u32,
21078 #[doc = "Floating point value"]
21079 pub value: f32,
21080 #[doc = "Name of the debug variable"]
21081 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21082 pub name: [u8; 10],
21083}
21084impl NAMED_VALUE_FLOAT_DATA {
21085 pub const ENCODED_LEN: usize = 18usize;
21086 pub const DEFAULT: Self = Self {
21087 time_boot_ms: 0_u32,
21088 value: 0.0_f32,
21089 name: [0_u8; 10usize],
21090 };
21091 #[cfg(feature = "arbitrary")]
21092 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21093 use arbitrary::{Arbitrary, Unstructured};
21094 let mut buf = [0u8; 1024];
21095 rng.fill_bytes(&mut buf);
21096 let mut unstructured = Unstructured::new(&buf);
21097 Self::arbitrary(&mut unstructured).unwrap_or_default()
21098 }
21099}
21100impl Default for NAMED_VALUE_FLOAT_DATA {
21101 fn default() -> Self {
21102 Self::DEFAULT.clone()
21103 }
21104}
21105impl MessageData for NAMED_VALUE_FLOAT_DATA {
21106 type Message = MavMessage;
21107 const ID: u32 = 251u32;
21108 const NAME: &'static str = "NAMED_VALUE_FLOAT";
21109 const EXTRA_CRC: u8 = 170u8;
21110 const ENCODED_LEN: usize = 18usize;
21111 fn deser(
21112 _version: MavlinkVersion,
21113 __input: &[u8],
21114 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21115 let avail_len = __input.len();
21116 let mut payload_buf = [0; Self::ENCODED_LEN];
21117 let mut buf = if avail_len < Self::ENCODED_LEN {
21118 payload_buf[0..avail_len].copy_from_slice(__input);
21119 Bytes::new(&payload_buf)
21120 } else {
21121 Bytes::new(__input)
21122 };
21123 let mut __struct = Self::default();
21124 __struct.time_boot_ms = buf.get_u32_le();
21125 __struct.value = buf.get_f32_le();
21126 for v in &mut __struct.name {
21127 let val = buf.get_u8();
21128 *v = val;
21129 }
21130 Ok(__struct)
21131 }
21132 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21133 let mut __tmp = BytesMut::new(bytes);
21134 #[allow(clippy::absurd_extreme_comparisons)]
21135 #[allow(unused_comparisons)]
21136 if __tmp.remaining() < Self::ENCODED_LEN {
21137 panic!(
21138 "buffer is too small (need {} bytes, but got {})",
21139 Self::ENCODED_LEN,
21140 __tmp.remaining(),
21141 )
21142 }
21143 __tmp.put_u32_le(self.time_boot_ms);
21144 __tmp.put_f32_le(self.value);
21145 for val in &self.name {
21146 __tmp.put_u8(*val);
21147 }
21148 if matches!(version, MavlinkVersion::V2) {
21149 let len = __tmp.len();
21150 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21151 } else {
21152 __tmp.len()
21153 }
21154 }
21155}
21156#[doc = "id: 252"]
21157#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21158#[derive(Debug, Clone, PartialEq)]
21159#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21160#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21161pub struct NAMED_VALUE_INT_DATA {
21162 #[doc = "Timestamp (time since system boot)."]
21163 pub time_boot_ms: u32,
21164 #[doc = "Signed integer value"]
21165 pub value: i32,
21166 #[doc = "Name of the debug variable"]
21167 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21168 pub name: [u8; 10],
21169}
21170impl NAMED_VALUE_INT_DATA {
21171 pub const ENCODED_LEN: usize = 18usize;
21172 pub const DEFAULT: Self = Self {
21173 time_boot_ms: 0_u32,
21174 value: 0_i32,
21175 name: [0_u8; 10usize],
21176 };
21177 #[cfg(feature = "arbitrary")]
21178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21179 use arbitrary::{Arbitrary, Unstructured};
21180 let mut buf = [0u8; 1024];
21181 rng.fill_bytes(&mut buf);
21182 let mut unstructured = Unstructured::new(&buf);
21183 Self::arbitrary(&mut unstructured).unwrap_or_default()
21184 }
21185}
21186impl Default for NAMED_VALUE_INT_DATA {
21187 fn default() -> Self {
21188 Self::DEFAULT.clone()
21189 }
21190}
21191impl MessageData for NAMED_VALUE_INT_DATA {
21192 type Message = MavMessage;
21193 const ID: u32 = 252u32;
21194 const NAME: &'static str = "NAMED_VALUE_INT";
21195 const EXTRA_CRC: u8 = 44u8;
21196 const ENCODED_LEN: usize = 18usize;
21197 fn deser(
21198 _version: MavlinkVersion,
21199 __input: &[u8],
21200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21201 let avail_len = __input.len();
21202 let mut payload_buf = [0; Self::ENCODED_LEN];
21203 let mut buf = if avail_len < Self::ENCODED_LEN {
21204 payload_buf[0..avail_len].copy_from_slice(__input);
21205 Bytes::new(&payload_buf)
21206 } else {
21207 Bytes::new(__input)
21208 };
21209 let mut __struct = Self::default();
21210 __struct.time_boot_ms = buf.get_u32_le();
21211 __struct.value = buf.get_i32_le();
21212 for v in &mut __struct.name {
21213 let val = buf.get_u8();
21214 *v = val;
21215 }
21216 Ok(__struct)
21217 }
21218 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21219 let mut __tmp = BytesMut::new(bytes);
21220 #[allow(clippy::absurd_extreme_comparisons)]
21221 #[allow(unused_comparisons)]
21222 if __tmp.remaining() < Self::ENCODED_LEN {
21223 panic!(
21224 "buffer is too small (need {} bytes, but got {})",
21225 Self::ENCODED_LEN,
21226 __tmp.remaining(),
21227 )
21228 }
21229 __tmp.put_u32_le(self.time_boot_ms);
21230 __tmp.put_i32_le(self.value);
21231 for val in &self.name {
21232 __tmp.put_u8(*val);
21233 }
21234 if matches!(version, MavlinkVersion::V2) {
21235 let len = __tmp.len();
21236 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21237 } else {
21238 __tmp.len()
21239 }
21240 }
21241}
21242#[doc = "id: 62"]
21243#[doc = "The state of the navigation and position controller."]
21244#[derive(Debug, Clone, PartialEq)]
21245#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21246#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21247pub struct NAV_CONTROLLER_OUTPUT_DATA {
21248 #[doc = "Current desired roll"]
21249 pub nav_roll: f32,
21250 #[doc = "Current desired pitch"]
21251 pub nav_pitch: f32,
21252 #[doc = "Current altitude error"]
21253 pub alt_error: f32,
21254 #[doc = "Current airspeed error"]
21255 pub aspd_error: f32,
21256 #[doc = "Current crosstrack error on x-y plane"]
21257 pub xtrack_error: f32,
21258 #[doc = "Current desired heading"]
21259 pub nav_bearing: i16,
21260 #[doc = "Bearing to current waypoint/target"]
21261 pub target_bearing: i16,
21262 #[doc = "Distance to active waypoint"]
21263 pub wp_dist: u16,
21264}
21265impl NAV_CONTROLLER_OUTPUT_DATA {
21266 pub const ENCODED_LEN: usize = 26usize;
21267 pub const DEFAULT: Self = Self {
21268 nav_roll: 0.0_f32,
21269 nav_pitch: 0.0_f32,
21270 alt_error: 0.0_f32,
21271 aspd_error: 0.0_f32,
21272 xtrack_error: 0.0_f32,
21273 nav_bearing: 0_i16,
21274 target_bearing: 0_i16,
21275 wp_dist: 0_u16,
21276 };
21277 #[cfg(feature = "arbitrary")]
21278 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21279 use arbitrary::{Arbitrary, Unstructured};
21280 let mut buf = [0u8; 1024];
21281 rng.fill_bytes(&mut buf);
21282 let mut unstructured = Unstructured::new(&buf);
21283 Self::arbitrary(&mut unstructured).unwrap_or_default()
21284 }
21285}
21286impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21287 fn default() -> Self {
21288 Self::DEFAULT.clone()
21289 }
21290}
21291impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21292 type Message = MavMessage;
21293 const ID: u32 = 62u32;
21294 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21295 const EXTRA_CRC: u8 = 183u8;
21296 const ENCODED_LEN: usize = 26usize;
21297 fn deser(
21298 _version: MavlinkVersion,
21299 __input: &[u8],
21300 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21301 let avail_len = __input.len();
21302 let mut payload_buf = [0; Self::ENCODED_LEN];
21303 let mut buf = if avail_len < Self::ENCODED_LEN {
21304 payload_buf[0..avail_len].copy_from_slice(__input);
21305 Bytes::new(&payload_buf)
21306 } else {
21307 Bytes::new(__input)
21308 };
21309 let mut __struct = Self::default();
21310 __struct.nav_roll = buf.get_f32_le();
21311 __struct.nav_pitch = buf.get_f32_le();
21312 __struct.alt_error = buf.get_f32_le();
21313 __struct.aspd_error = buf.get_f32_le();
21314 __struct.xtrack_error = buf.get_f32_le();
21315 __struct.nav_bearing = buf.get_i16_le();
21316 __struct.target_bearing = buf.get_i16_le();
21317 __struct.wp_dist = buf.get_u16_le();
21318 Ok(__struct)
21319 }
21320 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21321 let mut __tmp = BytesMut::new(bytes);
21322 #[allow(clippy::absurd_extreme_comparisons)]
21323 #[allow(unused_comparisons)]
21324 if __tmp.remaining() < Self::ENCODED_LEN {
21325 panic!(
21326 "buffer is too small (need {} bytes, but got {})",
21327 Self::ENCODED_LEN,
21328 __tmp.remaining(),
21329 )
21330 }
21331 __tmp.put_f32_le(self.nav_roll);
21332 __tmp.put_f32_le(self.nav_pitch);
21333 __tmp.put_f32_le(self.alt_error);
21334 __tmp.put_f32_le(self.aspd_error);
21335 __tmp.put_f32_le(self.xtrack_error);
21336 __tmp.put_i16_le(self.nav_bearing);
21337 __tmp.put_i16_le(self.target_bearing);
21338 __tmp.put_u16_le(self.wp_dist);
21339 if matches!(version, MavlinkVersion::V2) {
21340 let len = __tmp.len();
21341 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21342 } else {
21343 __tmp.len()
21344 }
21345 }
21346}
21347#[doc = "id: 330"]
21348#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21349#[derive(Debug, Clone, PartialEq)]
21350#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21352pub struct OBSTACLE_DISTANCE_DATA {
21353 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21354 pub time_usec: u64,
21355 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21356 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21357 pub distances: [u16; 72],
21358 #[doc = "Minimum distance the sensor can measure."]
21359 pub min_distance: u16,
21360 #[doc = "Maximum distance the sensor can measure."]
21361 pub max_distance: u16,
21362 #[doc = "Class id of the distance sensor type."]
21363 pub sensor_type: MavDistanceSensor,
21364 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21365 pub increment: u8,
21366 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21367 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21368 pub increment_f: f32,
21369 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21370 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21371 pub angle_offset: f32,
21372 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21373 #[cfg_attr(feature = "serde", serde(default))]
21374 pub frame: MavFrame,
21375}
21376impl OBSTACLE_DISTANCE_DATA {
21377 pub const ENCODED_LEN: usize = 167usize;
21378 pub const DEFAULT: Self = Self {
21379 time_usec: 0_u64,
21380 distances: [0_u16; 72usize],
21381 min_distance: 0_u16,
21382 max_distance: 0_u16,
21383 sensor_type: MavDistanceSensor::DEFAULT,
21384 increment: 0_u8,
21385 increment_f: 0.0_f32,
21386 angle_offset: 0.0_f32,
21387 frame: MavFrame::DEFAULT,
21388 };
21389 #[cfg(feature = "arbitrary")]
21390 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21391 use arbitrary::{Arbitrary, Unstructured};
21392 let mut buf = [0u8; 1024];
21393 rng.fill_bytes(&mut buf);
21394 let mut unstructured = Unstructured::new(&buf);
21395 Self::arbitrary(&mut unstructured).unwrap_or_default()
21396 }
21397}
21398impl Default for OBSTACLE_DISTANCE_DATA {
21399 fn default() -> Self {
21400 Self::DEFAULT.clone()
21401 }
21402}
21403impl MessageData for OBSTACLE_DISTANCE_DATA {
21404 type Message = MavMessage;
21405 const ID: u32 = 330u32;
21406 const NAME: &'static str = "OBSTACLE_DISTANCE";
21407 const EXTRA_CRC: u8 = 23u8;
21408 const ENCODED_LEN: usize = 167usize;
21409 fn deser(
21410 _version: MavlinkVersion,
21411 __input: &[u8],
21412 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21413 let avail_len = __input.len();
21414 let mut payload_buf = [0; Self::ENCODED_LEN];
21415 let mut buf = if avail_len < Self::ENCODED_LEN {
21416 payload_buf[0..avail_len].copy_from_slice(__input);
21417 Bytes::new(&payload_buf)
21418 } else {
21419 Bytes::new(__input)
21420 };
21421 let mut __struct = Self::default();
21422 __struct.time_usec = buf.get_u64_le();
21423 for v in &mut __struct.distances {
21424 let val = buf.get_u16_le();
21425 *v = val;
21426 }
21427 __struct.min_distance = buf.get_u16_le();
21428 __struct.max_distance = buf.get_u16_le();
21429 let tmp = buf.get_u8();
21430 __struct.sensor_type =
21431 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21432 enum_type: "MavDistanceSensor",
21433 value: tmp as u32,
21434 })?;
21435 __struct.increment = buf.get_u8();
21436 __struct.increment_f = buf.get_f32_le();
21437 __struct.angle_offset = buf.get_f32_le();
21438 let tmp = buf.get_u8();
21439 __struct.frame =
21440 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21441 enum_type: "MavFrame",
21442 value: tmp as u32,
21443 })?;
21444 Ok(__struct)
21445 }
21446 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21447 let mut __tmp = BytesMut::new(bytes);
21448 #[allow(clippy::absurd_extreme_comparisons)]
21449 #[allow(unused_comparisons)]
21450 if __tmp.remaining() < Self::ENCODED_LEN {
21451 panic!(
21452 "buffer is too small (need {} bytes, but got {})",
21453 Self::ENCODED_LEN,
21454 __tmp.remaining(),
21455 )
21456 }
21457 __tmp.put_u64_le(self.time_usec);
21458 for val in &self.distances {
21459 __tmp.put_u16_le(*val);
21460 }
21461 __tmp.put_u16_le(self.min_distance);
21462 __tmp.put_u16_le(self.max_distance);
21463 __tmp.put_u8(self.sensor_type as u8);
21464 __tmp.put_u8(self.increment);
21465 __tmp.put_f32_le(self.increment_f);
21466 __tmp.put_f32_le(self.angle_offset);
21467 __tmp.put_u8(self.frame as u8);
21468 if matches!(version, MavlinkVersion::V2) {
21469 let len = __tmp.len();
21470 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21471 } else {
21472 __tmp.len()
21473 }
21474 }
21475}
21476#[doc = "id: 331"]
21477#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21478#[derive(Debug, Clone, PartialEq)]
21479#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21481pub struct ODOMETRY_DATA {
21482 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21483 pub time_usec: u64,
21484 #[doc = "X Position"]
21485 pub x: f32,
21486 #[doc = "Y Position"]
21487 pub y: f32,
21488 #[doc = "Z Position"]
21489 pub z: f32,
21490 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21491 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21492 pub q: [f32; 4],
21493 #[doc = "X linear speed"]
21494 pub vx: f32,
21495 #[doc = "Y linear speed"]
21496 pub vy: f32,
21497 #[doc = "Z linear speed"]
21498 pub vz: f32,
21499 #[doc = "Roll angular speed"]
21500 pub rollspeed: f32,
21501 #[doc = "Pitch angular speed"]
21502 pub pitchspeed: f32,
21503 #[doc = "Yaw angular speed"]
21504 pub yawspeed: f32,
21505 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21506 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21507 pub pose_covariance: [f32; 21],
21508 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21509 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21510 pub velocity_covariance: [f32; 21],
21511 #[doc = "Coordinate frame of reference for the pose data."]
21512 pub frame_id: MavFrame,
21513 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21514 pub child_frame_id: MavFrame,
21515 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21516 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21517 pub reset_counter: u8,
21518 #[doc = "Type of estimator that is providing the odometry."]
21519 #[cfg_attr(feature = "serde", serde(default))]
21520 pub estimator_type: MavEstimatorType,
21521 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21522 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21523 pub quality: i8,
21524}
21525impl ODOMETRY_DATA {
21526 pub const ENCODED_LEN: usize = 233usize;
21527 pub const DEFAULT: Self = Self {
21528 time_usec: 0_u64,
21529 x: 0.0_f32,
21530 y: 0.0_f32,
21531 z: 0.0_f32,
21532 q: [0.0_f32; 4usize],
21533 vx: 0.0_f32,
21534 vy: 0.0_f32,
21535 vz: 0.0_f32,
21536 rollspeed: 0.0_f32,
21537 pitchspeed: 0.0_f32,
21538 yawspeed: 0.0_f32,
21539 pose_covariance: [0.0_f32; 21usize],
21540 velocity_covariance: [0.0_f32; 21usize],
21541 frame_id: MavFrame::DEFAULT,
21542 child_frame_id: MavFrame::DEFAULT,
21543 reset_counter: 0_u8,
21544 estimator_type: MavEstimatorType::DEFAULT,
21545 quality: 0_i8,
21546 };
21547 #[cfg(feature = "arbitrary")]
21548 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21549 use arbitrary::{Arbitrary, Unstructured};
21550 let mut buf = [0u8; 1024];
21551 rng.fill_bytes(&mut buf);
21552 let mut unstructured = Unstructured::new(&buf);
21553 Self::arbitrary(&mut unstructured).unwrap_or_default()
21554 }
21555}
21556impl Default for ODOMETRY_DATA {
21557 fn default() -> Self {
21558 Self::DEFAULT.clone()
21559 }
21560}
21561impl MessageData for ODOMETRY_DATA {
21562 type Message = MavMessage;
21563 const ID: u32 = 331u32;
21564 const NAME: &'static str = "ODOMETRY";
21565 const EXTRA_CRC: u8 = 91u8;
21566 const ENCODED_LEN: usize = 233usize;
21567 fn deser(
21568 _version: MavlinkVersion,
21569 __input: &[u8],
21570 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21571 let avail_len = __input.len();
21572 let mut payload_buf = [0; Self::ENCODED_LEN];
21573 let mut buf = if avail_len < Self::ENCODED_LEN {
21574 payload_buf[0..avail_len].copy_from_slice(__input);
21575 Bytes::new(&payload_buf)
21576 } else {
21577 Bytes::new(__input)
21578 };
21579 let mut __struct = Self::default();
21580 __struct.time_usec = buf.get_u64_le();
21581 __struct.x = buf.get_f32_le();
21582 __struct.y = buf.get_f32_le();
21583 __struct.z = buf.get_f32_le();
21584 for v in &mut __struct.q {
21585 let val = buf.get_f32_le();
21586 *v = val;
21587 }
21588 __struct.vx = buf.get_f32_le();
21589 __struct.vy = buf.get_f32_le();
21590 __struct.vz = buf.get_f32_le();
21591 __struct.rollspeed = buf.get_f32_le();
21592 __struct.pitchspeed = buf.get_f32_le();
21593 __struct.yawspeed = buf.get_f32_le();
21594 for v in &mut __struct.pose_covariance {
21595 let val = buf.get_f32_le();
21596 *v = val;
21597 }
21598 for v in &mut __struct.velocity_covariance {
21599 let val = buf.get_f32_le();
21600 *v = val;
21601 }
21602 let tmp = buf.get_u8();
21603 __struct.frame_id =
21604 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21605 enum_type: "MavFrame",
21606 value: tmp as u32,
21607 })?;
21608 let tmp = buf.get_u8();
21609 __struct.child_frame_id =
21610 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21611 enum_type: "MavFrame",
21612 value: tmp as u32,
21613 })?;
21614 __struct.reset_counter = buf.get_u8();
21615 let tmp = buf.get_u8();
21616 __struct.estimator_type =
21617 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21618 enum_type: "MavEstimatorType",
21619 value: tmp as u32,
21620 })?;
21621 __struct.quality = buf.get_i8();
21622 Ok(__struct)
21623 }
21624 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21625 let mut __tmp = BytesMut::new(bytes);
21626 #[allow(clippy::absurd_extreme_comparisons)]
21627 #[allow(unused_comparisons)]
21628 if __tmp.remaining() < Self::ENCODED_LEN {
21629 panic!(
21630 "buffer is too small (need {} bytes, but got {})",
21631 Self::ENCODED_LEN,
21632 __tmp.remaining(),
21633 )
21634 }
21635 __tmp.put_u64_le(self.time_usec);
21636 __tmp.put_f32_le(self.x);
21637 __tmp.put_f32_le(self.y);
21638 __tmp.put_f32_le(self.z);
21639 for val in &self.q {
21640 __tmp.put_f32_le(*val);
21641 }
21642 __tmp.put_f32_le(self.vx);
21643 __tmp.put_f32_le(self.vy);
21644 __tmp.put_f32_le(self.vz);
21645 __tmp.put_f32_le(self.rollspeed);
21646 __tmp.put_f32_le(self.pitchspeed);
21647 __tmp.put_f32_le(self.yawspeed);
21648 for val in &self.pose_covariance {
21649 __tmp.put_f32_le(*val);
21650 }
21651 for val in &self.velocity_covariance {
21652 __tmp.put_f32_le(*val);
21653 }
21654 __tmp.put_u8(self.frame_id as u8);
21655 __tmp.put_u8(self.child_frame_id as u8);
21656 __tmp.put_u8(self.reset_counter);
21657 __tmp.put_u8(self.estimator_type as u8);
21658 __tmp.put_i8(self.quality);
21659 if matches!(version, MavlinkVersion::V2) {
21660 let len = __tmp.len();
21661 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21662 } else {
21663 __tmp.len()
21664 }
21665 }
21666}
21667#[doc = "id: 390"]
21668#[doc = "Hardware status sent by an onboard computer."]
21669#[derive(Debug, Clone, PartialEq)]
21670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21672pub struct ONBOARD_COMPUTER_STATUS_DATA {
21673 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21674 pub time_usec: u64,
21675 #[doc = "Time since system boot."]
21676 pub uptime: u32,
21677 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21678 pub ram_usage: u32,
21679 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21680 pub ram_total: u32,
21681 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21683 pub storage_type: [u32; 4],
21684 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21685 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21686 pub storage_usage: [u32; 4],
21687 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21688 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21689 pub storage_total: [u32; 4],
21690 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21691 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21692 pub link_type: [u32; 6],
21693 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21694 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21695 pub link_tx_rate: [u32; 6],
21696 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21697 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21698 pub link_rx_rate: [u32; 6],
21699 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21700 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21701 pub link_tx_max: [u32; 6],
21702 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21703 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21704 pub link_rx_max: [u32; 6],
21705 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21706 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21707 pub fan_speed: [i16; 4],
21708 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21709 pub mavtype: u8,
21710 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21711 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21712 pub cpu_cores: [u8; 8],
21713 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21714 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21715 pub cpu_combined: [u8; 10],
21716 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21717 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21718 pub gpu_cores: [u8; 4],
21719 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21720 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21721 pub gpu_combined: [u8; 10],
21722 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21723 pub temperature_board: i8,
21724 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21725 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21726 pub temperature_core: [i8; 8],
21727}
21728impl ONBOARD_COMPUTER_STATUS_DATA {
21729 pub const ENCODED_LEN: usize = 238usize;
21730 pub const DEFAULT: Self = Self {
21731 time_usec: 0_u64,
21732 uptime: 0_u32,
21733 ram_usage: 0_u32,
21734 ram_total: 0_u32,
21735 storage_type: [0_u32; 4usize],
21736 storage_usage: [0_u32; 4usize],
21737 storage_total: [0_u32; 4usize],
21738 link_type: [0_u32; 6usize],
21739 link_tx_rate: [0_u32; 6usize],
21740 link_rx_rate: [0_u32; 6usize],
21741 link_tx_max: [0_u32; 6usize],
21742 link_rx_max: [0_u32; 6usize],
21743 fan_speed: [0_i16; 4usize],
21744 mavtype: 0_u8,
21745 cpu_cores: [0_u8; 8usize],
21746 cpu_combined: [0_u8; 10usize],
21747 gpu_cores: [0_u8; 4usize],
21748 gpu_combined: [0_u8; 10usize],
21749 temperature_board: 0_i8,
21750 temperature_core: [0_i8; 8usize],
21751 };
21752 #[cfg(feature = "arbitrary")]
21753 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21754 use arbitrary::{Arbitrary, Unstructured};
21755 let mut buf = [0u8; 1024];
21756 rng.fill_bytes(&mut buf);
21757 let mut unstructured = Unstructured::new(&buf);
21758 Self::arbitrary(&mut unstructured).unwrap_or_default()
21759 }
21760}
21761impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21762 fn default() -> Self {
21763 Self::DEFAULT.clone()
21764 }
21765}
21766impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21767 type Message = MavMessage;
21768 const ID: u32 = 390u32;
21769 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21770 const EXTRA_CRC: u8 = 156u8;
21771 const ENCODED_LEN: usize = 238usize;
21772 fn deser(
21773 _version: MavlinkVersion,
21774 __input: &[u8],
21775 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21776 let avail_len = __input.len();
21777 let mut payload_buf = [0; Self::ENCODED_LEN];
21778 let mut buf = if avail_len < Self::ENCODED_LEN {
21779 payload_buf[0..avail_len].copy_from_slice(__input);
21780 Bytes::new(&payload_buf)
21781 } else {
21782 Bytes::new(__input)
21783 };
21784 let mut __struct = Self::default();
21785 __struct.time_usec = buf.get_u64_le();
21786 __struct.uptime = buf.get_u32_le();
21787 __struct.ram_usage = buf.get_u32_le();
21788 __struct.ram_total = buf.get_u32_le();
21789 for v in &mut __struct.storage_type {
21790 let val = buf.get_u32_le();
21791 *v = val;
21792 }
21793 for v in &mut __struct.storage_usage {
21794 let val = buf.get_u32_le();
21795 *v = val;
21796 }
21797 for v in &mut __struct.storage_total {
21798 let val = buf.get_u32_le();
21799 *v = val;
21800 }
21801 for v in &mut __struct.link_type {
21802 let val = buf.get_u32_le();
21803 *v = val;
21804 }
21805 for v in &mut __struct.link_tx_rate {
21806 let val = buf.get_u32_le();
21807 *v = val;
21808 }
21809 for v in &mut __struct.link_rx_rate {
21810 let val = buf.get_u32_le();
21811 *v = val;
21812 }
21813 for v in &mut __struct.link_tx_max {
21814 let val = buf.get_u32_le();
21815 *v = val;
21816 }
21817 for v in &mut __struct.link_rx_max {
21818 let val = buf.get_u32_le();
21819 *v = val;
21820 }
21821 for v in &mut __struct.fan_speed {
21822 let val = buf.get_i16_le();
21823 *v = val;
21824 }
21825 __struct.mavtype = buf.get_u8();
21826 for v in &mut __struct.cpu_cores {
21827 let val = buf.get_u8();
21828 *v = val;
21829 }
21830 for v in &mut __struct.cpu_combined {
21831 let val = buf.get_u8();
21832 *v = val;
21833 }
21834 for v in &mut __struct.gpu_cores {
21835 let val = buf.get_u8();
21836 *v = val;
21837 }
21838 for v in &mut __struct.gpu_combined {
21839 let val = buf.get_u8();
21840 *v = val;
21841 }
21842 __struct.temperature_board = buf.get_i8();
21843 for v in &mut __struct.temperature_core {
21844 let val = buf.get_i8();
21845 *v = val;
21846 }
21847 Ok(__struct)
21848 }
21849 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21850 let mut __tmp = BytesMut::new(bytes);
21851 #[allow(clippy::absurd_extreme_comparisons)]
21852 #[allow(unused_comparisons)]
21853 if __tmp.remaining() < Self::ENCODED_LEN {
21854 panic!(
21855 "buffer is too small (need {} bytes, but got {})",
21856 Self::ENCODED_LEN,
21857 __tmp.remaining(),
21858 )
21859 }
21860 __tmp.put_u64_le(self.time_usec);
21861 __tmp.put_u32_le(self.uptime);
21862 __tmp.put_u32_le(self.ram_usage);
21863 __tmp.put_u32_le(self.ram_total);
21864 for val in &self.storage_type {
21865 __tmp.put_u32_le(*val);
21866 }
21867 for val in &self.storage_usage {
21868 __tmp.put_u32_le(*val);
21869 }
21870 for val in &self.storage_total {
21871 __tmp.put_u32_le(*val);
21872 }
21873 for val in &self.link_type {
21874 __tmp.put_u32_le(*val);
21875 }
21876 for val in &self.link_tx_rate {
21877 __tmp.put_u32_le(*val);
21878 }
21879 for val in &self.link_rx_rate {
21880 __tmp.put_u32_le(*val);
21881 }
21882 for val in &self.link_tx_max {
21883 __tmp.put_u32_le(*val);
21884 }
21885 for val in &self.link_rx_max {
21886 __tmp.put_u32_le(*val);
21887 }
21888 for val in &self.fan_speed {
21889 __tmp.put_i16_le(*val);
21890 }
21891 __tmp.put_u8(self.mavtype);
21892 for val in &self.cpu_cores {
21893 __tmp.put_u8(*val);
21894 }
21895 for val in &self.cpu_combined {
21896 __tmp.put_u8(*val);
21897 }
21898 for val in &self.gpu_cores {
21899 __tmp.put_u8(*val);
21900 }
21901 for val in &self.gpu_combined {
21902 __tmp.put_u8(*val);
21903 }
21904 __tmp.put_i8(self.temperature_board);
21905 for val in &self.temperature_core {
21906 __tmp.put_i8(*val);
21907 }
21908 if matches!(version, MavlinkVersion::V2) {
21909 let len = __tmp.len();
21910 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21911 } else {
21912 __tmp.len()
21913 }
21914 }
21915}
21916#[doc = "id: 12918"]
21917#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21918#[derive(Debug, Clone, PartialEq)]
21919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21921pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21922 #[doc = "Status level indicating if arming is allowed."]
21923 pub status: MavOdidArmStatus,
21924 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21925 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21926 pub error: [u8; 50],
21927}
21928impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21929 pub const ENCODED_LEN: usize = 51usize;
21930 pub const DEFAULT: Self = Self {
21931 status: MavOdidArmStatus::DEFAULT,
21932 error: [0_u8; 50usize],
21933 };
21934 #[cfg(feature = "arbitrary")]
21935 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21936 use arbitrary::{Arbitrary, Unstructured};
21937 let mut buf = [0u8; 1024];
21938 rng.fill_bytes(&mut buf);
21939 let mut unstructured = Unstructured::new(&buf);
21940 Self::arbitrary(&mut unstructured).unwrap_or_default()
21941 }
21942}
21943impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21944 fn default() -> Self {
21945 Self::DEFAULT.clone()
21946 }
21947}
21948impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21949 type Message = MavMessage;
21950 const ID: u32 = 12918u32;
21951 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21952 const EXTRA_CRC: u8 = 139u8;
21953 const ENCODED_LEN: usize = 51usize;
21954 fn deser(
21955 _version: MavlinkVersion,
21956 __input: &[u8],
21957 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21958 let avail_len = __input.len();
21959 let mut payload_buf = [0; Self::ENCODED_LEN];
21960 let mut buf = if avail_len < Self::ENCODED_LEN {
21961 payload_buf[0..avail_len].copy_from_slice(__input);
21962 Bytes::new(&payload_buf)
21963 } else {
21964 Bytes::new(__input)
21965 };
21966 let mut __struct = Self::default();
21967 let tmp = buf.get_u8();
21968 __struct.status =
21969 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21970 enum_type: "MavOdidArmStatus",
21971 value: tmp as u32,
21972 })?;
21973 for v in &mut __struct.error {
21974 let val = buf.get_u8();
21975 *v = val;
21976 }
21977 Ok(__struct)
21978 }
21979 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21980 let mut __tmp = BytesMut::new(bytes);
21981 #[allow(clippy::absurd_extreme_comparisons)]
21982 #[allow(unused_comparisons)]
21983 if __tmp.remaining() < Self::ENCODED_LEN {
21984 panic!(
21985 "buffer is too small (need {} bytes, but got {})",
21986 Self::ENCODED_LEN,
21987 __tmp.remaining(),
21988 )
21989 }
21990 __tmp.put_u8(self.status as u8);
21991 for val in &self.error {
21992 __tmp.put_u8(*val);
21993 }
21994 if matches!(version, MavlinkVersion::V2) {
21995 let len = __tmp.len();
21996 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21997 } else {
21998 __tmp.len()
21999 }
22000 }
22001}
22002#[doc = "id: 12902"]
22003#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
22004#[derive(Debug, Clone, PartialEq)]
22005#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22006#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22007pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
22008 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22009 pub timestamp: u32,
22010 #[doc = "System ID (0 for broadcast)."]
22011 pub target_system: u8,
22012 #[doc = "Component ID (0 for broadcast)."]
22013 pub target_component: u8,
22014 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22015 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22016 pub id_or_mac: [u8; 20],
22017 #[doc = "Indicates the type of authentication."]
22018 pub authentication_type: MavOdidAuthType,
22019 #[doc = "Allowed range is 0 - 15."]
22020 pub data_page: u8,
22021 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22022 pub last_page_index: u8,
22023 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22024 pub length: u8,
22025 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
22026 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22027 pub authentication_data: [u8; 23],
22028}
22029impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
22030 pub const ENCODED_LEN: usize = 53usize;
22031 pub const DEFAULT: Self = Self {
22032 timestamp: 0_u32,
22033 target_system: 0_u8,
22034 target_component: 0_u8,
22035 id_or_mac: [0_u8; 20usize],
22036 authentication_type: MavOdidAuthType::DEFAULT,
22037 data_page: 0_u8,
22038 last_page_index: 0_u8,
22039 length: 0_u8,
22040 authentication_data: [0_u8; 23usize],
22041 };
22042 #[cfg(feature = "arbitrary")]
22043 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22044 use arbitrary::{Arbitrary, Unstructured};
22045 let mut buf = [0u8; 1024];
22046 rng.fill_bytes(&mut buf);
22047 let mut unstructured = Unstructured::new(&buf);
22048 Self::arbitrary(&mut unstructured).unwrap_or_default()
22049 }
22050}
22051impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22052 fn default() -> Self {
22053 Self::DEFAULT.clone()
22054 }
22055}
22056impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22057 type Message = MavMessage;
22058 const ID: u32 = 12902u32;
22059 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
22060 const EXTRA_CRC: u8 = 140u8;
22061 const ENCODED_LEN: usize = 53usize;
22062 fn deser(
22063 _version: MavlinkVersion,
22064 __input: &[u8],
22065 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22066 let avail_len = __input.len();
22067 let mut payload_buf = [0; Self::ENCODED_LEN];
22068 let mut buf = if avail_len < Self::ENCODED_LEN {
22069 payload_buf[0..avail_len].copy_from_slice(__input);
22070 Bytes::new(&payload_buf)
22071 } else {
22072 Bytes::new(__input)
22073 };
22074 let mut __struct = Self::default();
22075 __struct.timestamp = buf.get_u32_le();
22076 __struct.target_system = buf.get_u8();
22077 __struct.target_component = buf.get_u8();
22078 for v in &mut __struct.id_or_mac {
22079 let val = buf.get_u8();
22080 *v = val;
22081 }
22082 let tmp = buf.get_u8();
22083 __struct.authentication_type =
22084 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22085 enum_type: "MavOdidAuthType",
22086 value: tmp as u32,
22087 })?;
22088 __struct.data_page = buf.get_u8();
22089 __struct.last_page_index = buf.get_u8();
22090 __struct.length = buf.get_u8();
22091 for v in &mut __struct.authentication_data {
22092 let val = buf.get_u8();
22093 *v = val;
22094 }
22095 Ok(__struct)
22096 }
22097 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22098 let mut __tmp = BytesMut::new(bytes);
22099 #[allow(clippy::absurd_extreme_comparisons)]
22100 #[allow(unused_comparisons)]
22101 if __tmp.remaining() < Self::ENCODED_LEN {
22102 panic!(
22103 "buffer is too small (need {} bytes, but got {})",
22104 Self::ENCODED_LEN,
22105 __tmp.remaining(),
22106 )
22107 }
22108 __tmp.put_u32_le(self.timestamp);
22109 __tmp.put_u8(self.target_system);
22110 __tmp.put_u8(self.target_component);
22111 for val in &self.id_or_mac {
22112 __tmp.put_u8(*val);
22113 }
22114 __tmp.put_u8(self.authentication_type as u8);
22115 __tmp.put_u8(self.data_page);
22116 __tmp.put_u8(self.last_page_index);
22117 __tmp.put_u8(self.length);
22118 for val in &self.authentication_data {
22119 __tmp.put_u8(*val);
22120 }
22121 if matches!(version, MavlinkVersion::V2) {
22122 let len = __tmp.len();
22123 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22124 } else {
22125 __tmp.len()
22126 }
22127 }
22128}
22129#[doc = "id: 12900"]
22130#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22131#[derive(Debug, Clone, PartialEq)]
22132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22133#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22134pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22135 #[doc = "System ID (0 for broadcast)."]
22136 pub target_system: u8,
22137 #[doc = "Component ID (0 for broadcast)."]
22138 pub target_component: u8,
22139 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22140 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22141 pub id_or_mac: [u8; 20],
22142 #[doc = "Indicates the format for the uas_id field of this message."]
22143 pub id_type: MavOdidIdType,
22144 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22145 pub ua_type: MavOdidUaType,
22146 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22147 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22148 pub uas_id: [u8; 20],
22149}
22150impl OPEN_DRONE_ID_BASIC_ID_DATA {
22151 pub const ENCODED_LEN: usize = 44usize;
22152 pub const DEFAULT: Self = Self {
22153 target_system: 0_u8,
22154 target_component: 0_u8,
22155 id_or_mac: [0_u8; 20usize],
22156 id_type: MavOdidIdType::DEFAULT,
22157 ua_type: MavOdidUaType::DEFAULT,
22158 uas_id: [0_u8; 20usize],
22159 };
22160 #[cfg(feature = "arbitrary")]
22161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22162 use arbitrary::{Arbitrary, Unstructured};
22163 let mut buf = [0u8; 1024];
22164 rng.fill_bytes(&mut buf);
22165 let mut unstructured = Unstructured::new(&buf);
22166 Self::arbitrary(&mut unstructured).unwrap_or_default()
22167 }
22168}
22169impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22170 fn default() -> Self {
22171 Self::DEFAULT.clone()
22172 }
22173}
22174impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22175 type Message = MavMessage;
22176 const ID: u32 = 12900u32;
22177 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22178 const EXTRA_CRC: u8 = 114u8;
22179 const ENCODED_LEN: usize = 44usize;
22180 fn deser(
22181 _version: MavlinkVersion,
22182 __input: &[u8],
22183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22184 let avail_len = __input.len();
22185 let mut payload_buf = [0; Self::ENCODED_LEN];
22186 let mut buf = if avail_len < Self::ENCODED_LEN {
22187 payload_buf[0..avail_len].copy_from_slice(__input);
22188 Bytes::new(&payload_buf)
22189 } else {
22190 Bytes::new(__input)
22191 };
22192 let mut __struct = Self::default();
22193 __struct.target_system = buf.get_u8();
22194 __struct.target_component = buf.get_u8();
22195 for v in &mut __struct.id_or_mac {
22196 let val = buf.get_u8();
22197 *v = val;
22198 }
22199 let tmp = buf.get_u8();
22200 __struct.id_type =
22201 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22202 enum_type: "MavOdidIdType",
22203 value: tmp as u32,
22204 })?;
22205 let tmp = buf.get_u8();
22206 __struct.ua_type =
22207 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22208 enum_type: "MavOdidUaType",
22209 value: tmp as u32,
22210 })?;
22211 for v in &mut __struct.uas_id {
22212 let val = buf.get_u8();
22213 *v = val;
22214 }
22215 Ok(__struct)
22216 }
22217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22218 let mut __tmp = BytesMut::new(bytes);
22219 #[allow(clippy::absurd_extreme_comparisons)]
22220 #[allow(unused_comparisons)]
22221 if __tmp.remaining() < Self::ENCODED_LEN {
22222 panic!(
22223 "buffer is too small (need {} bytes, but got {})",
22224 Self::ENCODED_LEN,
22225 __tmp.remaining(),
22226 )
22227 }
22228 __tmp.put_u8(self.target_system);
22229 __tmp.put_u8(self.target_component);
22230 for val in &self.id_or_mac {
22231 __tmp.put_u8(*val);
22232 }
22233 __tmp.put_u8(self.id_type as u8);
22234 __tmp.put_u8(self.ua_type as u8);
22235 for val in &self.uas_id {
22236 __tmp.put_u8(*val);
22237 }
22238 if matches!(version, MavlinkVersion::V2) {
22239 let len = __tmp.len();
22240 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22241 } else {
22242 __tmp.len()
22243 }
22244 }
22245}
22246#[doc = "id: 12901"]
22247#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22248#[derive(Debug, Clone, PartialEq)]
22249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22250#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22251pub struct OPEN_DRONE_ID_LOCATION_DATA {
22252 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22253 pub latitude: i32,
22254 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22255 pub longitude: i32,
22256 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22257 pub altitude_barometric: f32,
22258 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22259 pub altitude_geodetic: f32,
22260 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22261 pub height: f32,
22262 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22263 pub timestamp: f32,
22264 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22265 pub direction: u16,
22266 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22267 pub speed_horizontal: u16,
22268 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22269 pub speed_vertical: i16,
22270 #[doc = "System ID (0 for broadcast)."]
22271 pub target_system: u8,
22272 #[doc = "Component ID (0 for broadcast)."]
22273 pub target_component: u8,
22274 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22275 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22276 pub id_or_mac: [u8; 20],
22277 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22278 pub status: MavOdidStatus,
22279 #[doc = "Indicates the reference point for the height field."]
22280 pub height_reference: MavOdidHeightRef,
22281 #[doc = "The accuracy of the horizontal position."]
22282 pub horizontal_accuracy: MavOdidHorAcc,
22283 #[doc = "The accuracy of the vertical position."]
22284 pub vertical_accuracy: MavOdidVerAcc,
22285 #[doc = "The accuracy of the barometric altitude."]
22286 pub barometer_accuracy: MavOdidVerAcc,
22287 #[doc = "The accuracy of the horizontal and vertical speed."]
22288 pub speed_accuracy: MavOdidSpeedAcc,
22289 #[doc = "The accuracy of the timestamps."]
22290 pub timestamp_accuracy: MavOdidTimeAcc,
22291}
22292impl OPEN_DRONE_ID_LOCATION_DATA {
22293 pub const ENCODED_LEN: usize = 59usize;
22294 pub const DEFAULT: Self = Self {
22295 latitude: 0_i32,
22296 longitude: 0_i32,
22297 altitude_barometric: 0.0_f32,
22298 altitude_geodetic: 0.0_f32,
22299 height: 0.0_f32,
22300 timestamp: 0.0_f32,
22301 direction: 0_u16,
22302 speed_horizontal: 0_u16,
22303 speed_vertical: 0_i16,
22304 target_system: 0_u8,
22305 target_component: 0_u8,
22306 id_or_mac: [0_u8; 20usize],
22307 status: MavOdidStatus::DEFAULT,
22308 height_reference: MavOdidHeightRef::DEFAULT,
22309 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22310 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22311 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22312 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22313 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22314 };
22315 #[cfg(feature = "arbitrary")]
22316 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22317 use arbitrary::{Arbitrary, Unstructured};
22318 let mut buf = [0u8; 1024];
22319 rng.fill_bytes(&mut buf);
22320 let mut unstructured = Unstructured::new(&buf);
22321 Self::arbitrary(&mut unstructured).unwrap_or_default()
22322 }
22323}
22324impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22325 fn default() -> Self {
22326 Self::DEFAULT.clone()
22327 }
22328}
22329impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22330 type Message = MavMessage;
22331 const ID: u32 = 12901u32;
22332 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22333 const EXTRA_CRC: u8 = 254u8;
22334 const ENCODED_LEN: usize = 59usize;
22335 fn deser(
22336 _version: MavlinkVersion,
22337 __input: &[u8],
22338 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22339 let avail_len = __input.len();
22340 let mut payload_buf = [0; Self::ENCODED_LEN];
22341 let mut buf = if avail_len < Self::ENCODED_LEN {
22342 payload_buf[0..avail_len].copy_from_slice(__input);
22343 Bytes::new(&payload_buf)
22344 } else {
22345 Bytes::new(__input)
22346 };
22347 let mut __struct = Self::default();
22348 __struct.latitude = buf.get_i32_le();
22349 __struct.longitude = buf.get_i32_le();
22350 __struct.altitude_barometric = buf.get_f32_le();
22351 __struct.altitude_geodetic = buf.get_f32_le();
22352 __struct.height = buf.get_f32_le();
22353 __struct.timestamp = buf.get_f32_le();
22354 __struct.direction = buf.get_u16_le();
22355 __struct.speed_horizontal = buf.get_u16_le();
22356 __struct.speed_vertical = buf.get_i16_le();
22357 __struct.target_system = buf.get_u8();
22358 __struct.target_component = buf.get_u8();
22359 for v in &mut __struct.id_or_mac {
22360 let val = buf.get_u8();
22361 *v = val;
22362 }
22363 let tmp = buf.get_u8();
22364 __struct.status =
22365 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22366 enum_type: "MavOdidStatus",
22367 value: tmp as u32,
22368 })?;
22369 let tmp = buf.get_u8();
22370 __struct.height_reference =
22371 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22372 enum_type: "MavOdidHeightRef",
22373 value: tmp as u32,
22374 })?;
22375 let tmp = buf.get_u8();
22376 __struct.horizontal_accuracy =
22377 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22378 enum_type: "MavOdidHorAcc",
22379 value: tmp as u32,
22380 })?;
22381 let tmp = buf.get_u8();
22382 __struct.vertical_accuracy =
22383 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22384 enum_type: "MavOdidVerAcc",
22385 value: tmp as u32,
22386 })?;
22387 let tmp = buf.get_u8();
22388 __struct.barometer_accuracy =
22389 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22390 enum_type: "MavOdidVerAcc",
22391 value: tmp as u32,
22392 })?;
22393 let tmp = buf.get_u8();
22394 __struct.speed_accuracy =
22395 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22396 enum_type: "MavOdidSpeedAcc",
22397 value: tmp as u32,
22398 })?;
22399 let tmp = buf.get_u8();
22400 __struct.timestamp_accuracy =
22401 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22402 enum_type: "MavOdidTimeAcc",
22403 value: tmp as u32,
22404 })?;
22405 Ok(__struct)
22406 }
22407 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22408 let mut __tmp = BytesMut::new(bytes);
22409 #[allow(clippy::absurd_extreme_comparisons)]
22410 #[allow(unused_comparisons)]
22411 if __tmp.remaining() < Self::ENCODED_LEN {
22412 panic!(
22413 "buffer is too small (need {} bytes, but got {})",
22414 Self::ENCODED_LEN,
22415 __tmp.remaining(),
22416 )
22417 }
22418 __tmp.put_i32_le(self.latitude);
22419 __tmp.put_i32_le(self.longitude);
22420 __tmp.put_f32_le(self.altitude_barometric);
22421 __tmp.put_f32_le(self.altitude_geodetic);
22422 __tmp.put_f32_le(self.height);
22423 __tmp.put_f32_le(self.timestamp);
22424 __tmp.put_u16_le(self.direction);
22425 __tmp.put_u16_le(self.speed_horizontal);
22426 __tmp.put_i16_le(self.speed_vertical);
22427 __tmp.put_u8(self.target_system);
22428 __tmp.put_u8(self.target_component);
22429 for val in &self.id_or_mac {
22430 __tmp.put_u8(*val);
22431 }
22432 __tmp.put_u8(self.status as u8);
22433 __tmp.put_u8(self.height_reference as u8);
22434 __tmp.put_u8(self.horizontal_accuracy as u8);
22435 __tmp.put_u8(self.vertical_accuracy as u8);
22436 __tmp.put_u8(self.barometer_accuracy as u8);
22437 __tmp.put_u8(self.speed_accuracy as u8);
22438 __tmp.put_u8(self.timestamp_accuracy as u8);
22439 if matches!(version, MavlinkVersion::V2) {
22440 let len = __tmp.len();
22441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22442 } else {
22443 __tmp.len()
22444 }
22445 }
22446}
22447#[doc = "id: 12915"]
22448#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22449#[derive(Debug, Clone, PartialEq)]
22450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22452pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22453 #[doc = "System ID (0 for broadcast)."]
22454 pub target_system: u8,
22455 #[doc = "Component ID (0 for broadcast)."]
22456 pub target_component: u8,
22457 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22458 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22459 pub id_or_mac: [u8; 20],
22460 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22461 pub single_message_size: u8,
22462 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22463 pub msg_pack_size: u8,
22464 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22465 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22466 pub messages: [u8; 225],
22467}
22468impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22469 pub const ENCODED_LEN: usize = 249usize;
22470 pub const DEFAULT: Self = Self {
22471 target_system: 0_u8,
22472 target_component: 0_u8,
22473 id_or_mac: [0_u8; 20usize],
22474 single_message_size: 0_u8,
22475 msg_pack_size: 0_u8,
22476 messages: [0_u8; 225usize],
22477 };
22478 #[cfg(feature = "arbitrary")]
22479 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22480 use arbitrary::{Arbitrary, Unstructured};
22481 let mut buf = [0u8; 1024];
22482 rng.fill_bytes(&mut buf);
22483 let mut unstructured = Unstructured::new(&buf);
22484 Self::arbitrary(&mut unstructured).unwrap_or_default()
22485 }
22486}
22487impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22488 fn default() -> Self {
22489 Self::DEFAULT.clone()
22490 }
22491}
22492impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22493 type Message = MavMessage;
22494 const ID: u32 = 12915u32;
22495 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22496 const EXTRA_CRC: u8 = 94u8;
22497 const ENCODED_LEN: usize = 249usize;
22498 fn deser(
22499 _version: MavlinkVersion,
22500 __input: &[u8],
22501 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22502 let avail_len = __input.len();
22503 let mut payload_buf = [0; Self::ENCODED_LEN];
22504 let mut buf = if avail_len < Self::ENCODED_LEN {
22505 payload_buf[0..avail_len].copy_from_slice(__input);
22506 Bytes::new(&payload_buf)
22507 } else {
22508 Bytes::new(__input)
22509 };
22510 let mut __struct = Self::default();
22511 __struct.target_system = buf.get_u8();
22512 __struct.target_component = buf.get_u8();
22513 for v in &mut __struct.id_or_mac {
22514 let val = buf.get_u8();
22515 *v = val;
22516 }
22517 __struct.single_message_size = buf.get_u8();
22518 __struct.msg_pack_size = buf.get_u8();
22519 for v in &mut __struct.messages {
22520 let val = buf.get_u8();
22521 *v = val;
22522 }
22523 Ok(__struct)
22524 }
22525 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22526 let mut __tmp = BytesMut::new(bytes);
22527 #[allow(clippy::absurd_extreme_comparisons)]
22528 #[allow(unused_comparisons)]
22529 if __tmp.remaining() < Self::ENCODED_LEN {
22530 panic!(
22531 "buffer is too small (need {} bytes, but got {})",
22532 Self::ENCODED_LEN,
22533 __tmp.remaining(),
22534 )
22535 }
22536 __tmp.put_u8(self.target_system);
22537 __tmp.put_u8(self.target_component);
22538 for val in &self.id_or_mac {
22539 __tmp.put_u8(*val);
22540 }
22541 __tmp.put_u8(self.single_message_size);
22542 __tmp.put_u8(self.msg_pack_size);
22543 for val in &self.messages {
22544 __tmp.put_u8(*val);
22545 }
22546 if matches!(version, MavlinkVersion::V2) {
22547 let len = __tmp.len();
22548 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22549 } else {
22550 __tmp.len()
22551 }
22552 }
22553}
22554#[doc = "id: 12905"]
22555#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22556#[derive(Debug, Clone, PartialEq)]
22557#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22558#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22559pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22560 #[doc = "System ID (0 for broadcast)."]
22561 pub target_system: u8,
22562 #[doc = "Component ID (0 for broadcast)."]
22563 pub target_component: u8,
22564 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22565 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22566 pub id_or_mac: [u8; 20],
22567 #[doc = "Indicates the type of the operator_id field."]
22568 pub operator_id_type: MavOdidOperatorIdType,
22569 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22570 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22571 pub operator_id: [u8; 20],
22572}
22573impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22574 pub const ENCODED_LEN: usize = 43usize;
22575 pub const DEFAULT: Self = Self {
22576 target_system: 0_u8,
22577 target_component: 0_u8,
22578 id_or_mac: [0_u8; 20usize],
22579 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22580 operator_id: [0_u8; 20usize],
22581 };
22582 #[cfg(feature = "arbitrary")]
22583 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22584 use arbitrary::{Arbitrary, Unstructured};
22585 let mut buf = [0u8; 1024];
22586 rng.fill_bytes(&mut buf);
22587 let mut unstructured = Unstructured::new(&buf);
22588 Self::arbitrary(&mut unstructured).unwrap_or_default()
22589 }
22590}
22591impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22592 fn default() -> Self {
22593 Self::DEFAULT.clone()
22594 }
22595}
22596impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22597 type Message = MavMessage;
22598 const ID: u32 = 12905u32;
22599 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22600 const EXTRA_CRC: u8 = 49u8;
22601 const ENCODED_LEN: usize = 43usize;
22602 fn deser(
22603 _version: MavlinkVersion,
22604 __input: &[u8],
22605 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22606 let avail_len = __input.len();
22607 let mut payload_buf = [0; Self::ENCODED_LEN];
22608 let mut buf = if avail_len < Self::ENCODED_LEN {
22609 payload_buf[0..avail_len].copy_from_slice(__input);
22610 Bytes::new(&payload_buf)
22611 } else {
22612 Bytes::new(__input)
22613 };
22614 let mut __struct = Self::default();
22615 __struct.target_system = buf.get_u8();
22616 __struct.target_component = buf.get_u8();
22617 for v in &mut __struct.id_or_mac {
22618 let val = buf.get_u8();
22619 *v = val;
22620 }
22621 let tmp = buf.get_u8();
22622 __struct.operator_id_type =
22623 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22624 enum_type: "MavOdidOperatorIdType",
22625 value: tmp as u32,
22626 })?;
22627 for v in &mut __struct.operator_id {
22628 let val = buf.get_u8();
22629 *v = val;
22630 }
22631 Ok(__struct)
22632 }
22633 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22634 let mut __tmp = BytesMut::new(bytes);
22635 #[allow(clippy::absurd_extreme_comparisons)]
22636 #[allow(unused_comparisons)]
22637 if __tmp.remaining() < Self::ENCODED_LEN {
22638 panic!(
22639 "buffer is too small (need {} bytes, but got {})",
22640 Self::ENCODED_LEN,
22641 __tmp.remaining(),
22642 )
22643 }
22644 __tmp.put_u8(self.target_system);
22645 __tmp.put_u8(self.target_component);
22646 for val in &self.id_or_mac {
22647 __tmp.put_u8(*val);
22648 }
22649 __tmp.put_u8(self.operator_id_type as u8);
22650 for val in &self.operator_id {
22651 __tmp.put_u8(*val);
22652 }
22653 if matches!(version, MavlinkVersion::V2) {
22654 let len = __tmp.len();
22655 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22656 } else {
22657 __tmp.len()
22658 }
22659 }
22660}
22661#[doc = "id: 12903"]
22662#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22663#[derive(Debug, Clone, PartialEq)]
22664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22666pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22667 #[doc = "System ID (0 for broadcast)."]
22668 pub target_system: u8,
22669 #[doc = "Component ID (0 for broadcast)."]
22670 pub target_component: u8,
22671 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22672 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22673 pub id_or_mac: [u8; 20],
22674 #[doc = "Indicates the type of the description field."]
22675 pub description_type: MavOdidDescType,
22676 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22677 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22678 pub description: [u8; 23],
22679}
22680impl OPEN_DRONE_ID_SELF_ID_DATA {
22681 pub const ENCODED_LEN: usize = 46usize;
22682 pub const DEFAULT: Self = Self {
22683 target_system: 0_u8,
22684 target_component: 0_u8,
22685 id_or_mac: [0_u8; 20usize],
22686 description_type: MavOdidDescType::DEFAULT,
22687 description: [0_u8; 23usize],
22688 };
22689 #[cfg(feature = "arbitrary")]
22690 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22691 use arbitrary::{Arbitrary, Unstructured};
22692 let mut buf = [0u8; 1024];
22693 rng.fill_bytes(&mut buf);
22694 let mut unstructured = Unstructured::new(&buf);
22695 Self::arbitrary(&mut unstructured).unwrap_or_default()
22696 }
22697}
22698impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22699 fn default() -> Self {
22700 Self::DEFAULT.clone()
22701 }
22702}
22703impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22704 type Message = MavMessage;
22705 const ID: u32 = 12903u32;
22706 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22707 const EXTRA_CRC: u8 = 249u8;
22708 const ENCODED_LEN: usize = 46usize;
22709 fn deser(
22710 _version: MavlinkVersion,
22711 __input: &[u8],
22712 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22713 let avail_len = __input.len();
22714 let mut payload_buf = [0; Self::ENCODED_LEN];
22715 let mut buf = if avail_len < Self::ENCODED_LEN {
22716 payload_buf[0..avail_len].copy_from_slice(__input);
22717 Bytes::new(&payload_buf)
22718 } else {
22719 Bytes::new(__input)
22720 };
22721 let mut __struct = Self::default();
22722 __struct.target_system = buf.get_u8();
22723 __struct.target_component = buf.get_u8();
22724 for v in &mut __struct.id_or_mac {
22725 let val = buf.get_u8();
22726 *v = val;
22727 }
22728 let tmp = buf.get_u8();
22729 __struct.description_type =
22730 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22731 enum_type: "MavOdidDescType",
22732 value: tmp as u32,
22733 })?;
22734 for v in &mut __struct.description {
22735 let val = buf.get_u8();
22736 *v = val;
22737 }
22738 Ok(__struct)
22739 }
22740 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22741 let mut __tmp = BytesMut::new(bytes);
22742 #[allow(clippy::absurd_extreme_comparisons)]
22743 #[allow(unused_comparisons)]
22744 if __tmp.remaining() < Self::ENCODED_LEN {
22745 panic!(
22746 "buffer is too small (need {} bytes, but got {})",
22747 Self::ENCODED_LEN,
22748 __tmp.remaining(),
22749 )
22750 }
22751 __tmp.put_u8(self.target_system);
22752 __tmp.put_u8(self.target_component);
22753 for val in &self.id_or_mac {
22754 __tmp.put_u8(*val);
22755 }
22756 __tmp.put_u8(self.description_type as u8);
22757 for val in &self.description {
22758 __tmp.put_u8(*val);
22759 }
22760 if matches!(version, MavlinkVersion::V2) {
22761 let len = __tmp.len();
22762 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22763 } else {
22764 __tmp.len()
22765 }
22766 }
22767}
22768#[doc = "id: 12904"]
22769#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22770#[derive(Debug, Clone, PartialEq)]
22771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22773pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22774 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22775 pub operator_latitude: i32,
22776 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22777 pub operator_longitude: i32,
22778 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22779 pub area_ceiling: f32,
22780 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22781 pub area_floor: f32,
22782 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22783 pub operator_altitude_geo: f32,
22784 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22785 pub timestamp: u32,
22786 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22787 pub area_count: u16,
22788 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22789 pub area_radius: u16,
22790 #[doc = "System ID (0 for broadcast)."]
22791 pub target_system: u8,
22792 #[doc = "Component ID (0 for broadcast)."]
22793 pub target_component: u8,
22794 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22796 pub id_or_mac: [u8; 20],
22797 #[doc = "Specifies the operator location type."]
22798 pub operator_location_type: MavOdidOperatorLocationType,
22799 #[doc = "Specifies the classification type of the UA."]
22800 pub classification_type: MavOdidClassificationType,
22801 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22802 pub category_eu: MavOdidCategoryEu,
22803 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22804 pub class_eu: MavOdidClassEu,
22805}
22806impl OPEN_DRONE_ID_SYSTEM_DATA {
22807 pub const ENCODED_LEN: usize = 54usize;
22808 pub const DEFAULT: Self = Self {
22809 operator_latitude: 0_i32,
22810 operator_longitude: 0_i32,
22811 area_ceiling: 0.0_f32,
22812 area_floor: 0.0_f32,
22813 operator_altitude_geo: 0.0_f32,
22814 timestamp: 0_u32,
22815 area_count: 0_u16,
22816 area_radius: 0_u16,
22817 target_system: 0_u8,
22818 target_component: 0_u8,
22819 id_or_mac: [0_u8; 20usize],
22820 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22821 classification_type: MavOdidClassificationType::DEFAULT,
22822 category_eu: MavOdidCategoryEu::DEFAULT,
22823 class_eu: MavOdidClassEu::DEFAULT,
22824 };
22825 #[cfg(feature = "arbitrary")]
22826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22827 use arbitrary::{Arbitrary, Unstructured};
22828 let mut buf = [0u8; 1024];
22829 rng.fill_bytes(&mut buf);
22830 let mut unstructured = Unstructured::new(&buf);
22831 Self::arbitrary(&mut unstructured).unwrap_or_default()
22832 }
22833}
22834impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22835 fn default() -> Self {
22836 Self::DEFAULT.clone()
22837 }
22838}
22839impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22840 type Message = MavMessage;
22841 const ID: u32 = 12904u32;
22842 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22843 const EXTRA_CRC: u8 = 77u8;
22844 const ENCODED_LEN: usize = 54usize;
22845 fn deser(
22846 _version: MavlinkVersion,
22847 __input: &[u8],
22848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22849 let avail_len = __input.len();
22850 let mut payload_buf = [0; Self::ENCODED_LEN];
22851 let mut buf = if avail_len < Self::ENCODED_LEN {
22852 payload_buf[0..avail_len].copy_from_slice(__input);
22853 Bytes::new(&payload_buf)
22854 } else {
22855 Bytes::new(__input)
22856 };
22857 let mut __struct = Self::default();
22858 __struct.operator_latitude = buf.get_i32_le();
22859 __struct.operator_longitude = buf.get_i32_le();
22860 __struct.area_ceiling = buf.get_f32_le();
22861 __struct.area_floor = buf.get_f32_le();
22862 __struct.operator_altitude_geo = buf.get_f32_le();
22863 __struct.timestamp = buf.get_u32_le();
22864 __struct.area_count = buf.get_u16_le();
22865 __struct.area_radius = buf.get_u16_le();
22866 __struct.target_system = buf.get_u8();
22867 __struct.target_component = buf.get_u8();
22868 for v in &mut __struct.id_or_mac {
22869 let val = buf.get_u8();
22870 *v = val;
22871 }
22872 let tmp = buf.get_u8();
22873 __struct.operator_location_type =
22874 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22875 enum_type: "MavOdidOperatorLocationType",
22876 value: tmp as u32,
22877 })?;
22878 let tmp = buf.get_u8();
22879 __struct.classification_type =
22880 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22881 enum_type: "MavOdidClassificationType",
22882 value: tmp as u32,
22883 })?;
22884 let tmp = buf.get_u8();
22885 __struct.category_eu =
22886 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22887 enum_type: "MavOdidCategoryEu",
22888 value: tmp as u32,
22889 })?;
22890 let tmp = buf.get_u8();
22891 __struct.class_eu =
22892 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22893 enum_type: "MavOdidClassEu",
22894 value: tmp as u32,
22895 })?;
22896 Ok(__struct)
22897 }
22898 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22899 let mut __tmp = BytesMut::new(bytes);
22900 #[allow(clippy::absurd_extreme_comparisons)]
22901 #[allow(unused_comparisons)]
22902 if __tmp.remaining() < Self::ENCODED_LEN {
22903 panic!(
22904 "buffer is too small (need {} bytes, but got {})",
22905 Self::ENCODED_LEN,
22906 __tmp.remaining(),
22907 )
22908 }
22909 __tmp.put_i32_le(self.operator_latitude);
22910 __tmp.put_i32_le(self.operator_longitude);
22911 __tmp.put_f32_le(self.area_ceiling);
22912 __tmp.put_f32_le(self.area_floor);
22913 __tmp.put_f32_le(self.operator_altitude_geo);
22914 __tmp.put_u32_le(self.timestamp);
22915 __tmp.put_u16_le(self.area_count);
22916 __tmp.put_u16_le(self.area_radius);
22917 __tmp.put_u8(self.target_system);
22918 __tmp.put_u8(self.target_component);
22919 for val in &self.id_or_mac {
22920 __tmp.put_u8(*val);
22921 }
22922 __tmp.put_u8(self.operator_location_type as u8);
22923 __tmp.put_u8(self.classification_type as u8);
22924 __tmp.put_u8(self.category_eu as u8);
22925 __tmp.put_u8(self.class_eu as u8);
22926 if matches!(version, MavlinkVersion::V2) {
22927 let len = __tmp.len();
22928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22929 } else {
22930 __tmp.len()
22931 }
22932 }
22933}
22934#[doc = "id: 12919"]
22935#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22936#[derive(Debug, Clone, PartialEq)]
22937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22939pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22940 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22941 pub operator_latitude: i32,
22942 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22943 pub operator_longitude: i32,
22944 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22945 pub operator_altitude_geo: f32,
22946 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22947 pub timestamp: u32,
22948 #[doc = "System ID (0 for broadcast)."]
22949 pub target_system: u8,
22950 #[doc = "Component ID (0 for broadcast)."]
22951 pub target_component: u8,
22952}
22953impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22954 pub const ENCODED_LEN: usize = 18usize;
22955 pub const DEFAULT: Self = Self {
22956 operator_latitude: 0_i32,
22957 operator_longitude: 0_i32,
22958 operator_altitude_geo: 0.0_f32,
22959 timestamp: 0_u32,
22960 target_system: 0_u8,
22961 target_component: 0_u8,
22962 };
22963 #[cfg(feature = "arbitrary")]
22964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22965 use arbitrary::{Arbitrary, Unstructured};
22966 let mut buf = [0u8; 1024];
22967 rng.fill_bytes(&mut buf);
22968 let mut unstructured = Unstructured::new(&buf);
22969 Self::arbitrary(&mut unstructured).unwrap_or_default()
22970 }
22971}
22972impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22973 fn default() -> Self {
22974 Self::DEFAULT.clone()
22975 }
22976}
22977impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22978 type Message = MavMessage;
22979 const ID: u32 = 12919u32;
22980 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22981 const EXTRA_CRC: u8 = 7u8;
22982 const ENCODED_LEN: usize = 18usize;
22983 fn deser(
22984 _version: MavlinkVersion,
22985 __input: &[u8],
22986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22987 let avail_len = __input.len();
22988 let mut payload_buf = [0; Self::ENCODED_LEN];
22989 let mut buf = if avail_len < Self::ENCODED_LEN {
22990 payload_buf[0..avail_len].copy_from_slice(__input);
22991 Bytes::new(&payload_buf)
22992 } else {
22993 Bytes::new(__input)
22994 };
22995 let mut __struct = Self::default();
22996 __struct.operator_latitude = buf.get_i32_le();
22997 __struct.operator_longitude = buf.get_i32_le();
22998 __struct.operator_altitude_geo = buf.get_f32_le();
22999 __struct.timestamp = buf.get_u32_le();
23000 __struct.target_system = buf.get_u8();
23001 __struct.target_component = buf.get_u8();
23002 Ok(__struct)
23003 }
23004 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23005 let mut __tmp = BytesMut::new(bytes);
23006 #[allow(clippy::absurd_extreme_comparisons)]
23007 #[allow(unused_comparisons)]
23008 if __tmp.remaining() < Self::ENCODED_LEN {
23009 panic!(
23010 "buffer is too small (need {} bytes, but got {})",
23011 Self::ENCODED_LEN,
23012 __tmp.remaining(),
23013 )
23014 }
23015 __tmp.put_i32_le(self.operator_latitude);
23016 __tmp.put_i32_le(self.operator_longitude);
23017 __tmp.put_f32_le(self.operator_altitude_geo);
23018 __tmp.put_u32_le(self.timestamp);
23019 __tmp.put_u8(self.target_system);
23020 __tmp.put_u8(self.target_component);
23021 if matches!(version, MavlinkVersion::V2) {
23022 let len = __tmp.len();
23023 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23024 } else {
23025 __tmp.len()
23026 }
23027 }
23028}
23029#[doc = "id: 100"]
23030#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
23031#[derive(Debug, Clone, PartialEq)]
23032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23034pub struct OPTICAL_FLOW_DATA {
23035 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23036 pub time_usec: u64,
23037 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
23038 pub flow_comp_m_x: f32,
23039 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
23040 pub flow_comp_m_y: f32,
23041 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
23042 pub ground_distance: f32,
23043 #[doc = "Flow in x-sensor direction"]
23044 pub flow_x: i16,
23045 #[doc = "Flow in y-sensor direction"]
23046 pub flow_y: i16,
23047 #[doc = "Sensor ID"]
23048 pub sensor_id: u8,
23049 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23050 pub quality: u8,
23051 #[doc = "Flow rate about X axis"]
23052 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23053 pub flow_rate_x: f32,
23054 #[doc = "Flow rate about Y axis"]
23055 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23056 pub flow_rate_y: f32,
23057}
23058impl OPTICAL_FLOW_DATA {
23059 pub const ENCODED_LEN: usize = 34usize;
23060 pub const DEFAULT: Self = Self {
23061 time_usec: 0_u64,
23062 flow_comp_m_x: 0.0_f32,
23063 flow_comp_m_y: 0.0_f32,
23064 ground_distance: 0.0_f32,
23065 flow_x: 0_i16,
23066 flow_y: 0_i16,
23067 sensor_id: 0_u8,
23068 quality: 0_u8,
23069 flow_rate_x: 0.0_f32,
23070 flow_rate_y: 0.0_f32,
23071 };
23072 #[cfg(feature = "arbitrary")]
23073 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23074 use arbitrary::{Arbitrary, Unstructured};
23075 let mut buf = [0u8; 1024];
23076 rng.fill_bytes(&mut buf);
23077 let mut unstructured = Unstructured::new(&buf);
23078 Self::arbitrary(&mut unstructured).unwrap_or_default()
23079 }
23080}
23081impl Default for OPTICAL_FLOW_DATA {
23082 fn default() -> Self {
23083 Self::DEFAULT.clone()
23084 }
23085}
23086impl MessageData for OPTICAL_FLOW_DATA {
23087 type Message = MavMessage;
23088 const ID: u32 = 100u32;
23089 const NAME: &'static str = "OPTICAL_FLOW";
23090 const EXTRA_CRC: u8 = 175u8;
23091 const ENCODED_LEN: usize = 34usize;
23092 fn deser(
23093 _version: MavlinkVersion,
23094 __input: &[u8],
23095 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23096 let avail_len = __input.len();
23097 let mut payload_buf = [0; Self::ENCODED_LEN];
23098 let mut buf = if avail_len < Self::ENCODED_LEN {
23099 payload_buf[0..avail_len].copy_from_slice(__input);
23100 Bytes::new(&payload_buf)
23101 } else {
23102 Bytes::new(__input)
23103 };
23104 let mut __struct = Self::default();
23105 __struct.time_usec = buf.get_u64_le();
23106 __struct.flow_comp_m_x = buf.get_f32_le();
23107 __struct.flow_comp_m_y = buf.get_f32_le();
23108 __struct.ground_distance = buf.get_f32_le();
23109 __struct.flow_x = buf.get_i16_le();
23110 __struct.flow_y = buf.get_i16_le();
23111 __struct.sensor_id = buf.get_u8();
23112 __struct.quality = buf.get_u8();
23113 __struct.flow_rate_x = buf.get_f32_le();
23114 __struct.flow_rate_y = buf.get_f32_le();
23115 Ok(__struct)
23116 }
23117 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23118 let mut __tmp = BytesMut::new(bytes);
23119 #[allow(clippy::absurd_extreme_comparisons)]
23120 #[allow(unused_comparisons)]
23121 if __tmp.remaining() < Self::ENCODED_LEN {
23122 panic!(
23123 "buffer is too small (need {} bytes, but got {})",
23124 Self::ENCODED_LEN,
23125 __tmp.remaining(),
23126 )
23127 }
23128 __tmp.put_u64_le(self.time_usec);
23129 __tmp.put_f32_le(self.flow_comp_m_x);
23130 __tmp.put_f32_le(self.flow_comp_m_y);
23131 __tmp.put_f32_le(self.ground_distance);
23132 __tmp.put_i16_le(self.flow_x);
23133 __tmp.put_i16_le(self.flow_y);
23134 __tmp.put_u8(self.sensor_id);
23135 __tmp.put_u8(self.quality);
23136 __tmp.put_f32_le(self.flow_rate_x);
23137 __tmp.put_f32_le(self.flow_rate_y);
23138 if matches!(version, MavlinkVersion::V2) {
23139 let len = __tmp.len();
23140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23141 } else {
23142 __tmp.len()
23143 }
23144 }
23145}
23146#[doc = "id: 106"]
23147#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23148#[derive(Debug, Clone, PartialEq)]
23149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23151pub struct OPTICAL_FLOW_RAD_DATA {
23152 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23153 pub time_usec: u64,
23154 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23155 pub integration_time_us: u32,
23156 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23157 pub integrated_x: f32,
23158 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
23159 pub integrated_y: f32,
23160 #[doc = "RH rotation around X axis"]
23161 pub integrated_xgyro: f32,
23162 #[doc = "RH rotation around Y axis"]
23163 pub integrated_ygyro: f32,
23164 #[doc = "RH rotation around Z axis"]
23165 pub integrated_zgyro: f32,
23166 #[doc = "Time since the distance was sampled."]
23167 pub time_delta_distance_us: u32,
23168 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
23169 pub distance: f32,
23170 #[doc = "Temperature"]
23171 pub temperature: i16,
23172 #[doc = "Sensor ID"]
23173 pub sensor_id: u8,
23174 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
23175 pub quality: u8,
23176}
23177impl OPTICAL_FLOW_RAD_DATA {
23178 pub const ENCODED_LEN: usize = 44usize;
23179 pub const DEFAULT: Self = Self {
23180 time_usec: 0_u64,
23181 integration_time_us: 0_u32,
23182 integrated_x: 0.0_f32,
23183 integrated_y: 0.0_f32,
23184 integrated_xgyro: 0.0_f32,
23185 integrated_ygyro: 0.0_f32,
23186 integrated_zgyro: 0.0_f32,
23187 time_delta_distance_us: 0_u32,
23188 distance: 0.0_f32,
23189 temperature: 0_i16,
23190 sensor_id: 0_u8,
23191 quality: 0_u8,
23192 };
23193 #[cfg(feature = "arbitrary")]
23194 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23195 use arbitrary::{Arbitrary, Unstructured};
23196 let mut buf = [0u8; 1024];
23197 rng.fill_bytes(&mut buf);
23198 let mut unstructured = Unstructured::new(&buf);
23199 Self::arbitrary(&mut unstructured).unwrap_or_default()
23200 }
23201}
23202impl Default for OPTICAL_FLOW_RAD_DATA {
23203 fn default() -> Self {
23204 Self::DEFAULT.clone()
23205 }
23206}
23207impl MessageData for OPTICAL_FLOW_RAD_DATA {
23208 type Message = MavMessage;
23209 const ID: u32 = 106u32;
23210 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23211 const EXTRA_CRC: u8 = 138u8;
23212 const ENCODED_LEN: usize = 44usize;
23213 fn deser(
23214 _version: MavlinkVersion,
23215 __input: &[u8],
23216 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23217 let avail_len = __input.len();
23218 let mut payload_buf = [0; Self::ENCODED_LEN];
23219 let mut buf = if avail_len < Self::ENCODED_LEN {
23220 payload_buf[0..avail_len].copy_from_slice(__input);
23221 Bytes::new(&payload_buf)
23222 } else {
23223 Bytes::new(__input)
23224 };
23225 let mut __struct = Self::default();
23226 __struct.time_usec = buf.get_u64_le();
23227 __struct.integration_time_us = buf.get_u32_le();
23228 __struct.integrated_x = buf.get_f32_le();
23229 __struct.integrated_y = buf.get_f32_le();
23230 __struct.integrated_xgyro = buf.get_f32_le();
23231 __struct.integrated_ygyro = buf.get_f32_le();
23232 __struct.integrated_zgyro = buf.get_f32_le();
23233 __struct.time_delta_distance_us = buf.get_u32_le();
23234 __struct.distance = buf.get_f32_le();
23235 __struct.temperature = buf.get_i16_le();
23236 __struct.sensor_id = buf.get_u8();
23237 __struct.quality = buf.get_u8();
23238 Ok(__struct)
23239 }
23240 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23241 let mut __tmp = BytesMut::new(bytes);
23242 #[allow(clippy::absurd_extreme_comparisons)]
23243 #[allow(unused_comparisons)]
23244 if __tmp.remaining() < Self::ENCODED_LEN {
23245 panic!(
23246 "buffer is too small (need {} bytes, but got {})",
23247 Self::ENCODED_LEN,
23248 __tmp.remaining(),
23249 )
23250 }
23251 __tmp.put_u64_le(self.time_usec);
23252 __tmp.put_u32_le(self.integration_time_us);
23253 __tmp.put_f32_le(self.integrated_x);
23254 __tmp.put_f32_le(self.integrated_y);
23255 __tmp.put_f32_le(self.integrated_xgyro);
23256 __tmp.put_f32_le(self.integrated_ygyro);
23257 __tmp.put_f32_le(self.integrated_zgyro);
23258 __tmp.put_u32_le(self.time_delta_distance_us);
23259 __tmp.put_f32_le(self.distance);
23260 __tmp.put_i16_le(self.temperature);
23261 __tmp.put_u8(self.sensor_id);
23262 __tmp.put_u8(self.quality);
23263 if matches!(version, MavlinkVersion::V2) {
23264 let len = __tmp.len();
23265 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23266 } else {
23267 __tmp.len()
23268 }
23269 }
23270}
23271#[doc = "id: 360"]
23272#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23273#[derive(Debug, Clone, PartialEq)]
23274#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23275#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23276pub struct ORBIT_EXECUTION_STATUS_DATA {
23277 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23278 pub time_usec: u64,
23279 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23280 pub radius: f32,
23281 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23282 pub x: i32,
23283 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23284 pub y: i32,
23285 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23286 pub z: f32,
23287 #[doc = "The coordinate system of the fields: x, y, z."]
23288 pub frame: MavFrame,
23289}
23290impl ORBIT_EXECUTION_STATUS_DATA {
23291 pub const ENCODED_LEN: usize = 25usize;
23292 pub const DEFAULT: Self = Self {
23293 time_usec: 0_u64,
23294 radius: 0.0_f32,
23295 x: 0_i32,
23296 y: 0_i32,
23297 z: 0.0_f32,
23298 frame: MavFrame::DEFAULT,
23299 };
23300 #[cfg(feature = "arbitrary")]
23301 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23302 use arbitrary::{Arbitrary, Unstructured};
23303 let mut buf = [0u8; 1024];
23304 rng.fill_bytes(&mut buf);
23305 let mut unstructured = Unstructured::new(&buf);
23306 Self::arbitrary(&mut unstructured).unwrap_or_default()
23307 }
23308}
23309impl Default for ORBIT_EXECUTION_STATUS_DATA {
23310 fn default() -> Self {
23311 Self::DEFAULT.clone()
23312 }
23313}
23314impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23315 type Message = MavMessage;
23316 const ID: u32 = 360u32;
23317 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23318 const EXTRA_CRC: u8 = 11u8;
23319 const ENCODED_LEN: usize = 25usize;
23320 fn deser(
23321 _version: MavlinkVersion,
23322 __input: &[u8],
23323 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23324 let avail_len = __input.len();
23325 let mut payload_buf = [0; Self::ENCODED_LEN];
23326 let mut buf = if avail_len < Self::ENCODED_LEN {
23327 payload_buf[0..avail_len].copy_from_slice(__input);
23328 Bytes::new(&payload_buf)
23329 } else {
23330 Bytes::new(__input)
23331 };
23332 let mut __struct = Self::default();
23333 __struct.time_usec = buf.get_u64_le();
23334 __struct.radius = buf.get_f32_le();
23335 __struct.x = buf.get_i32_le();
23336 __struct.y = buf.get_i32_le();
23337 __struct.z = buf.get_f32_le();
23338 let tmp = buf.get_u8();
23339 __struct.frame =
23340 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23341 enum_type: "MavFrame",
23342 value: tmp as u32,
23343 })?;
23344 Ok(__struct)
23345 }
23346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23347 let mut __tmp = BytesMut::new(bytes);
23348 #[allow(clippy::absurd_extreme_comparisons)]
23349 #[allow(unused_comparisons)]
23350 if __tmp.remaining() < Self::ENCODED_LEN {
23351 panic!(
23352 "buffer is too small (need {} bytes, but got {})",
23353 Self::ENCODED_LEN,
23354 __tmp.remaining(),
23355 )
23356 }
23357 __tmp.put_u64_le(self.time_usec);
23358 __tmp.put_f32_le(self.radius);
23359 __tmp.put_i32_le(self.x);
23360 __tmp.put_i32_le(self.y);
23361 __tmp.put_f32_le(self.z);
23362 __tmp.put_u8(self.frame as u8);
23363 if matches!(version, MavlinkVersion::V2) {
23364 let len = __tmp.len();
23365 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23366 } else {
23367 __tmp.len()
23368 }
23369 }
23370}
23371#[doc = "id: 324"]
23372#[doc = "Response from a PARAM_EXT_SET message."]
23373#[derive(Debug, Clone, PartialEq)]
23374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23376pub struct PARAM_EXT_ACK_DATA {
23377 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23378 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23379 pub param_id: [u8; 16],
23380 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23381 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23382 pub param_value: [u8; 128],
23383 #[doc = "Parameter type."]
23384 pub param_type: MavParamExtType,
23385 #[doc = "Result code."]
23386 pub param_result: ParamAck,
23387}
23388impl PARAM_EXT_ACK_DATA {
23389 pub const ENCODED_LEN: usize = 146usize;
23390 pub const DEFAULT: Self = Self {
23391 param_id: [0_u8; 16usize],
23392 param_value: [0_u8; 128usize],
23393 param_type: MavParamExtType::DEFAULT,
23394 param_result: ParamAck::DEFAULT,
23395 };
23396 #[cfg(feature = "arbitrary")]
23397 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23398 use arbitrary::{Arbitrary, Unstructured};
23399 let mut buf = [0u8; 1024];
23400 rng.fill_bytes(&mut buf);
23401 let mut unstructured = Unstructured::new(&buf);
23402 Self::arbitrary(&mut unstructured).unwrap_or_default()
23403 }
23404}
23405impl Default for PARAM_EXT_ACK_DATA {
23406 fn default() -> Self {
23407 Self::DEFAULT.clone()
23408 }
23409}
23410impl MessageData for PARAM_EXT_ACK_DATA {
23411 type Message = MavMessage;
23412 const ID: u32 = 324u32;
23413 const NAME: &'static str = "PARAM_EXT_ACK";
23414 const EXTRA_CRC: u8 = 132u8;
23415 const ENCODED_LEN: usize = 146usize;
23416 fn deser(
23417 _version: MavlinkVersion,
23418 __input: &[u8],
23419 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23420 let avail_len = __input.len();
23421 let mut payload_buf = [0; Self::ENCODED_LEN];
23422 let mut buf = if avail_len < Self::ENCODED_LEN {
23423 payload_buf[0..avail_len].copy_from_slice(__input);
23424 Bytes::new(&payload_buf)
23425 } else {
23426 Bytes::new(__input)
23427 };
23428 let mut __struct = Self::default();
23429 for v in &mut __struct.param_id {
23430 let val = buf.get_u8();
23431 *v = val;
23432 }
23433 for v in &mut __struct.param_value {
23434 let val = buf.get_u8();
23435 *v = val;
23436 }
23437 let tmp = buf.get_u8();
23438 __struct.param_type =
23439 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23440 enum_type: "MavParamExtType",
23441 value: tmp as u32,
23442 })?;
23443 let tmp = buf.get_u8();
23444 __struct.param_result =
23445 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23446 enum_type: "ParamAck",
23447 value: tmp as u32,
23448 })?;
23449 Ok(__struct)
23450 }
23451 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23452 let mut __tmp = BytesMut::new(bytes);
23453 #[allow(clippy::absurd_extreme_comparisons)]
23454 #[allow(unused_comparisons)]
23455 if __tmp.remaining() < Self::ENCODED_LEN {
23456 panic!(
23457 "buffer is too small (need {} bytes, but got {})",
23458 Self::ENCODED_LEN,
23459 __tmp.remaining(),
23460 )
23461 }
23462 for val in &self.param_id {
23463 __tmp.put_u8(*val);
23464 }
23465 for val in &self.param_value {
23466 __tmp.put_u8(*val);
23467 }
23468 __tmp.put_u8(self.param_type as u8);
23469 __tmp.put_u8(self.param_result as u8);
23470 if matches!(version, MavlinkVersion::V2) {
23471 let len = __tmp.len();
23472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23473 } else {
23474 __tmp.len()
23475 }
23476 }
23477}
23478#[doc = "id: 321"]
23479#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23480#[derive(Debug, Clone, PartialEq)]
23481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23483pub struct PARAM_EXT_REQUEST_LIST_DATA {
23484 #[doc = "System ID"]
23485 pub target_system: u8,
23486 #[doc = "Component ID"]
23487 pub target_component: u8,
23488}
23489impl PARAM_EXT_REQUEST_LIST_DATA {
23490 pub const ENCODED_LEN: usize = 2usize;
23491 pub const DEFAULT: Self = Self {
23492 target_system: 0_u8,
23493 target_component: 0_u8,
23494 };
23495 #[cfg(feature = "arbitrary")]
23496 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23497 use arbitrary::{Arbitrary, Unstructured};
23498 let mut buf = [0u8; 1024];
23499 rng.fill_bytes(&mut buf);
23500 let mut unstructured = Unstructured::new(&buf);
23501 Self::arbitrary(&mut unstructured).unwrap_or_default()
23502 }
23503}
23504impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23505 fn default() -> Self {
23506 Self::DEFAULT.clone()
23507 }
23508}
23509impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23510 type Message = MavMessage;
23511 const ID: u32 = 321u32;
23512 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23513 const EXTRA_CRC: u8 = 88u8;
23514 const ENCODED_LEN: usize = 2usize;
23515 fn deser(
23516 _version: MavlinkVersion,
23517 __input: &[u8],
23518 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23519 let avail_len = __input.len();
23520 let mut payload_buf = [0; Self::ENCODED_LEN];
23521 let mut buf = if avail_len < Self::ENCODED_LEN {
23522 payload_buf[0..avail_len].copy_from_slice(__input);
23523 Bytes::new(&payload_buf)
23524 } else {
23525 Bytes::new(__input)
23526 };
23527 let mut __struct = Self::default();
23528 __struct.target_system = buf.get_u8();
23529 __struct.target_component = buf.get_u8();
23530 Ok(__struct)
23531 }
23532 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23533 let mut __tmp = BytesMut::new(bytes);
23534 #[allow(clippy::absurd_extreme_comparisons)]
23535 #[allow(unused_comparisons)]
23536 if __tmp.remaining() < Self::ENCODED_LEN {
23537 panic!(
23538 "buffer is too small (need {} bytes, but got {})",
23539 Self::ENCODED_LEN,
23540 __tmp.remaining(),
23541 )
23542 }
23543 __tmp.put_u8(self.target_system);
23544 __tmp.put_u8(self.target_component);
23545 if matches!(version, MavlinkVersion::V2) {
23546 let len = __tmp.len();
23547 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23548 } else {
23549 __tmp.len()
23550 }
23551 }
23552}
23553#[doc = "id: 320"]
23554#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23555#[derive(Debug, Clone, PartialEq)]
23556#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23557#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23558pub struct PARAM_EXT_REQUEST_READ_DATA {
23559 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23560 pub param_index: i16,
23561 #[doc = "System ID"]
23562 pub target_system: u8,
23563 #[doc = "Component ID"]
23564 pub target_component: u8,
23565 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23566 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23567 pub param_id: [u8; 16],
23568}
23569impl PARAM_EXT_REQUEST_READ_DATA {
23570 pub const ENCODED_LEN: usize = 20usize;
23571 pub const DEFAULT: Self = Self {
23572 param_index: 0_i16,
23573 target_system: 0_u8,
23574 target_component: 0_u8,
23575 param_id: [0_u8; 16usize],
23576 };
23577 #[cfg(feature = "arbitrary")]
23578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23579 use arbitrary::{Arbitrary, Unstructured};
23580 let mut buf = [0u8; 1024];
23581 rng.fill_bytes(&mut buf);
23582 let mut unstructured = Unstructured::new(&buf);
23583 Self::arbitrary(&mut unstructured).unwrap_or_default()
23584 }
23585}
23586impl Default for PARAM_EXT_REQUEST_READ_DATA {
23587 fn default() -> Self {
23588 Self::DEFAULT.clone()
23589 }
23590}
23591impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23592 type Message = MavMessage;
23593 const ID: u32 = 320u32;
23594 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23595 const EXTRA_CRC: u8 = 243u8;
23596 const ENCODED_LEN: usize = 20usize;
23597 fn deser(
23598 _version: MavlinkVersion,
23599 __input: &[u8],
23600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23601 let avail_len = __input.len();
23602 let mut payload_buf = [0; Self::ENCODED_LEN];
23603 let mut buf = if avail_len < Self::ENCODED_LEN {
23604 payload_buf[0..avail_len].copy_from_slice(__input);
23605 Bytes::new(&payload_buf)
23606 } else {
23607 Bytes::new(__input)
23608 };
23609 let mut __struct = Self::default();
23610 __struct.param_index = buf.get_i16_le();
23611 __struct.target_system = buf.get_u8();
23612 __struct.target_component = buf.get_u8();
23613 for v in &mut __struct.param_id {
23614 let val = buf.get_u8();
23615 *v = val;
23616 }
23617 Ok(__struct)
23618 }
23619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23620 let mut __tmp = BytesMut::new(bytes);
23621 #[allow(clippy::absurd_extreme_comparisons)]
23622 #[allow(unused_comparisons)]
23623 if __tmp.remaining() < Self::ENCODED_LEN {
23624 panic!(
23625 "buffer is too small (need {} bytes, but got {})",
23626 Self::ENCODED_LEN,
23627 __tmp.remaining(),
23628 )
23629 }
23630 __tmp.put_i16_le(self.param_index);
23631 __tmp.put_u8(self.target_system);
23632 __tmp.put_u8(self.target_component);
23633 for val in &self.param_id {
23634 __tmp.put_u8(*val);
23635 }
23636 if matches!(version, MavlinkVersion::V2) {
23637 let len = __tmp.len();
23638 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23639 } else {
23640 __tmp.len()
23641 }
23642 }
23643}
23644#[doc = "id: 323"]
23645#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23646#[derive(Debug, Clone, PartialEq)]
23647#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23649pub struct PARAM_EXT_SET_DATA {
23650 #[doc = "System ID"]
23651 pub target_system: u8,
23652 #[doc = "Component ID"]
23653 pub target_component: u8,
23654 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23655 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23656 pub param_id: [u8; 16],
23657 #[doc = "Parameter value"]
23658 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23659 pub param_value: [u8; 128],
23660 #[doc = "Parameter type."]
23661 pub param_type: MavParamExtType,
23662}
23663impl PARAM_EXT_SET_DATA {
23664 pub const ENCODED_LEN: usize = 147usize;
23665 pub const DEFAULT: Self = Self {
23666 target_system: 0_u8,
23667 target_component: 0_u8,
23668 param_id: [0_u8; 16usize],
23669 param_value: [0_u8; 128usize],
23670 param_type: MavParamExtType::DEFAULT,
23671 };
23672 #[cfg(feature = "arbitrary")]
23673 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23674 use arbitrary::{Arbitrary, Unstructured};
23675 let mut buf = [0u8; 1024];
23676 rng.fill_bytes(&mut buf);
23677 let mut unstructured = Unstructured::new(&buf);
23678 Self::arbitrary(&mut unstructured).unwrap_or_default()
23679 }
23680}
23681impl Default for PARAM_EXT_SET_DATA {
23682 fn default() -> Self {
23683 Self::DEFAULT.clone()
23684 }
23685}
23686impl MessageData for PARAM_EXT_SET_DATA {
23687 type Message = MavMessage;
23688 const ID: u32 = 323u32;
23689 const NAME: &'static str = "PARAM_EXT_SET";
23690 const EXTRA_CRC: u8 = 78u8;
23691 const ENCODED_LEN: usize = 147usize;
23692 fn deser(
23693 _version: MavlinkVersion,
23694 __input: &[u8],
23695 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23696 let avail_len = __input.len();
23697 let mut payload_buf = [0; Self::ENCODED_LEN];
23698 let mut buf = if avail_len < Self::ENCODED_LEN {
23699 payload_buf[0..avail_len].copy_from_slice(__input);
23700 Bytes::new(&payload_buf)
23701 } else {
23702 Bytes::new(__input)
23703 };
23704 let mut __struct = Self::default();
23705 __struct.target_system = buf.get_u8();
23706 __struct.target_component = buf.get_u8();
23707 for v in &mut __struct.param_id {
23708 let val = buf.get_u8();
23709 *v = val;
23710 }
23711 for v in &mut __struct.param_value {
23712 let val = buf.get_u8();
23713 *v = val;
23714 }
23715 let tmp = buf.get_u8();
23716 __struct.param_type =
23717 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23718 enum_type: "MavParamExtType",
23719 value: tmp as u32,
23720 })?;
23721 Ok(__struct)
23722 }
23723 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23724 let mut __tmp = BytesMut::new(bytes);
23725 #[allow(clippy::absurd_extreme_comparisons)]
23726 #[allow(unused_comparisons)]
23727 if __tmp.remaining() < Self::ENCODED_LEN {
23728 panic!(
23729 "buffer is too small (need {} bytes, but got {})",
23730 Self::ENCODED_LEN,
23731 __tmp.remaining(),
23732 )
23733 }
23734 __tmp.put_u8(self.target_system);
23735 __tmp.put_u8(self.target_component);
23736 for val in &self.param_id {
23737 __tmp.put_u8(*val);
23738 }
23739 for val in &self.param_value {
23740 __tmp.put_u8(*val);
23741 }
23742 __tmp.put_u8(self.param_type as u8);
23743 if matches!(version, MavlinkVersion::V2) {
23744 let len = __tmp.len();
23745 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23746 } else {
23747 __tmp.len()
23748 }
23749 }
23750}
23751#[doc = "id: 322"]
23752#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23753#[derive(Debug, Clone, PartialEq)]
23754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23756pub struct PARAM_EXT_VALUE_DATA {
23757 #[doc = "Total number of parameters"]
23758 pub param_count: u16,
23759 #[doc = "Index of this parameter"]
23760 pub param_index: u16,
23761 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23762 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23763 pub param_id: [u8; 16],
23764 #[doc = "Parameter value"]
23765 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23766 pub param_value: [u8; 128],
23767 #[doc = "Parameter type."]
23768 pub param_type: MavParamExtType,
23769}
23770impl PARAM_EXT_VALUE_DATA {
23771 pub const ENCODED_LEN: usize = 149usize;
23772 pub const DEFAULT: Self = Self {
23773 param_count: 0_u16,
23774 param_index: 0_u16,
23775 param_id: [0_u8; 16usize],
23776 param_value: [0_u8; 128usize],
23777 param_type: MavParamExtType::DEFAULT,
23778 };
23779 #[cfg(feature = "arbitrary")]
23780 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23781 use arbitrary::{Arbitrary, Unstructured};
23782 let mut buf = [0u8; 1024];
23783 rng.fill_bytes(&mut buf);
23784 let mut unstructured = Unstructured::new(&buf);
23785 Self::arbitrary(&mut unstructured).unwrap_or_default()
23786 }
23787}
23788impl Default for PARAM_EXT_VALUE_DATA {
23789 fn default() -> Self {
23790 Self::DEFAULT.clone()
23791 }
23792}
23793impl MessageData for PARAM_EXT_VALUE_DATA {
23794 type Message = MavMessage;
23795 const ID: u32 = 322u32;
23796 const NAME: &'static str = "PARAM_EXT_VALUE";
23797 const EXTRA_CRC: u8 = 243u8;
23798 const ENCODED_LEN: usize = 149usize;
23799 fn deser(
23800 _version: MavlinkVersion,
23801 __input: &[u8],
23802 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23803 let avail_len = __input.len();
23804 let mut payload_buf = [0; Self::ENCODED_LEN];
23805 let mut buf = if avail_len < Self::ENCODED_LEN {
23806 payload_buf[0..avail_len].copy_from_slice(__input);
23807 Bytes::new(&payload_buf)
23808 } else {
23809 Bytes::new(__input)
23810 };
23811 let mut __struct = Self::default();
23812 __struct.param_count = buf.get_u16_le();
23813 __struct.param_index = buf.get_u16_le();
23814 for v in &mut __struct.param_id {
23815 let val = buf.get_u8();
23816 *v = val;
23817 }
23818 for v in &mut __struct.param_value {
23819 let val = buf.get_u8();
23820 *v = val;
23821 }
23822 let tmp = buf.get_u8();
23823 __struct.param_type =
23824 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23825 enum_type: "MavParamExtType",
23826 value: tmp as u32,
23827 })?;
23828 Ok(__struct)
23829 }
23830 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23831 let mut __tmp = BytesMut::new(bytes);
23832 #[allow(clippy::absurd_extreme_comparisons)]
23833 #[allow(unused_comparisons)]
23834 if __tmp.remaining() < Self::ENCODED_LEN {
23835 panic!(
23836 "buffer is too small (need {} bytes, but got {})",
23837 Self::ENCODED_LEN,
23838 __tmp.remaining(),
23839 )
23840 }
23841 __tmp.put_u16_le(self.param_count);
23842 __tmp.put_u16_le(self.param_index);
23843 for val in &self.param_id {
23844 __tmp.put_u8(*val);
23845 }
23846 for val in &self.param_value {
23847 __tmp.put_u8(*val);
23848 }
23849 __tmp.put_u8(self.param_type as u8);
23850 if matches!(version, MavlinkVersion::V2) {
23851 let len = __tmp.len();
23852 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23853 } else {
23854 __tmp.len()
23855 }
23856 }
23857}
23858#[doc = "id: 50"]
23859#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23860#[derive(Debug, Clone, PartialEq)]
23861#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23862#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23863pub struct PARAM_MAP_RC_DATA {
23864 #[doc = "Initial parameter value"]
23865 pub param_value0: f32,
23866 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23867 pub scale: f32,
23868 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23869 pub param_value_min: f32,
23870 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23871 pub param_value_max: f32,
23872 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23873 pub param_index: i16,
23874 #[doc = "System ID"]
23875 pub target_system: u8,
23876 #[doc = "Component ID"]
23877 pub target_component: u8,
23878 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23879 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23880 pub param_id: [u8; 16],
23881 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23882 pub parameter_rc_channel_index: u8,
23883}
23884impl PARAM_MAP_RC_DATA {
23885 pub const ENCODED_LEN: usize = 37usize;
23886 pub const DEFAULT: Self = Self {
23887 param_value0: 0.0_f32,
23888 scale: 0.0_f32,
23889 param_value_min: 0.0_f32,
23890 param_value_max: 0.0_f32,
23891 param_index: 0_i16,
23892 target_system: 0_u8,
23893 target_component: 0_u8,
23894 param_id: [0_u8; 16usize],
23895 parameter_rc_channel_index: 0_u8,
23896 };
23897 #[cfg(feature = "arbitrary")]
23898 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23899 use arbitrary::{Arbitrary, Unstructured};
23900 let mut buf = [0u8; 1024];
23901 rng.fill_bytes(&mut buf);
23902 let mut unstructured = Unstructured::new(&buf);
23903 Self::arbitrary(&mut unstructured).unwrap_or_default()
23904 }
23905}
23906impl Default for PARAM_MAP_RC_DATA {
23907 fn default() -> Self {
23908 Self::DEFAULT.clone()
23909 }
23910}
23911impl MessageData for PARAM_MAP_RC_DATA {
23912 type Message = MavMessage;
23913 const ID: u32 = 50u32;
23914 const NAME: &'static str = "PARAM_MAP_RC";
23915 const EXTRA_CRC: u8 = 78u8;
23916 const ENCODED_LEN: usize = 37usize;
23917 fn deser(
23918 _version: MavlinkVersion,
23919 __input: &[u8],
23920 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23921 let avail_len = __input.len();
23922 let mut payload_buf = [0; Self::ENCODED_LEN];
23923 let mut buf = if avail_len < Self::ENCODED_LEN {
23924 payload_buf[0..avail_len].copy_from_slice(__input);
23925 Bytes::new(&payload_buf)
23926 } else {
23927 Bytes::new(__input)
23928 };
23929 let mut __struct = Self::default();
23930 __struct.param_value0 = buf.get_f32_le();
23931 __struct.scale = buf.get_f32_le();
23932 __struct.param_value_min = buf.get_f32_le();
23933 __struct.param_value_max = buf.get_f32_le();
23934 __struct.param_index = buf.get_i16_le();
23935 __struct.target_system = buf.get_u8();
23936 __struct.target_component = buf.get_u8();
23937 for v in &mut __struct.param_id {
23938 let val = buf.get_u8();
23939 *v = val;
23940 }
23941 __struct.parameter_rc_channel_index = buf.get_u8();
23942 Ok(__struct)
23943 }
23944 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23945 let mut __tmp = BytesMut::new(bytes);
23946 #[allow(clippy::absurd_extreme_comparisons)]
23947 #[allow(unused_comparisons)]
23948 if __tmp.remaining() < Self::ENCODED_LEN {
23949 panic!(
23950 "buffer is too small (need {} bytes, but got {})",
23951 Self::ENCODED_LEN,
23952 __tmp.remaining(),
23953 )
23954 }
23955 __tmp.put_f32_le(self.param_value0);
23956 __tmp.put_f32_le(self.scale);
23957 __tmp.put_f32_le(self.param_value_min);
23958 __tmp.put_f32_le(self.param_value_max);
23959 __tmp.put_i16_le(self.param_index);
23960 __tmp.put_u8(self.target_system);
23961 __tmp.put_u8(self.target_component);
23962 for val in &self.param_id {
23963 __tmp.put_u8(*val);
23964 }
23965 __tmp.put_u8(self.parameter_rc_channel_index);
23966 if matches!(version, MavlinkVersion::V2) {
23967 let len = __tmp.len();
23968 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23969 } else {
23970 __tmp.len()
23971 }
23972 }
23973}
23974#[doc = "id: 21"]
23975#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23976#[derive(Debug, Clone, PartialEq)]
23977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23979pub struct PARAM_REQUEST_LIST_DATA {
23980 #[doc = "System ID"]
23981 pub target_system: u8,
23982 #[doc = "Component ID"]
23983 pub target_component: u8,
23984}
23985impl PARAM_REQUEST_LIST_DATA {
23986 pub const ENCODED_LEN: usize = 2usize;
23987 pub const DEFAULT: Self = Self {
23988 target_system: 0_u8,
23989 target_component: 0_u8,
23990 };
23991 #[cfg(feature = "arbitrary")]
23992 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23993 use arbitrary::{Arbitrary, Unstructured};
23994 let mut buf = [0u8; 1024];
23995 rng.fill_bytes(&mut buf);
23996 let mut unstructured = Unstructured::new(&buf);
23997 Self::arbitrary(&mut unstructured).unwrap_or_default()
23998 }
23999}
24000impl Default for PARAM_REQUEST_LIST_DATA {
24001 fn default() -> Self {
24002 Self::DEFAULT.clone()
24003 }
24004}
24005impl MessageData for PARAM_REQUEST_LIST_DATA {
24006 type Message = MavMessage;
24007 const ID: u32 = 21u32;
24008 const NAME: &'static str = "PARAM_REQUEST_LIST";
24009 const EXTRA_CRC: u8 = 159u8;
24010 const ENCODED_LEN: usize = 2usize;
24011 fn deser(
24012 _version: MavlinkVersion,
24013 __input: &[u8],
24014 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24015 let avail_len = __input.len();
24016 let mut payload_buf = [0; Self::ENCODED_LEN];
24017 let mut buf = if avail_len < Self::ENCODED_LEN {
24018 payload_buf[0..avail_len].copy_from_slice(__input);
24019 Bytes::new(&payload_buf)
24020 } else {
24021 Bytes::new(__input)
24022 };
24023 let mut __struct = Self::default();
24024 __struct.target_system = buf.get_u8();
24025 __struct.target_component = buf.get_u8();
24026 Ok(__struct)
24027 }
24028 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24029 let mut __tmp = BytesMut::new(bytes);
24030 #[allow(clippy::absurd_extreme_comparisons)]
24031 #[allow(unused_comparisons)]
24032 if __tmp.remaining() < Self::ENCODED_LEN {
24033 panic!(
24034 "buffer is too small (need {} bytes, but got {})",
24035 Self::ENCODED_LEN,
24036 __tmp.remaining(),
24037 )
24038 }
24039 __tmp.put_u8(self.target_system);
24040 __tmp.put_u8(self.target_component);
24041 if matches!(version, MavlinkVersion::V2) {
24042 let len = __tmp.len();
24043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24044 } else {
24045 __tmp.len()
24046 }
24047 }
24048}
24049#[doc = "id: 20"]
24050#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24051#[derive(Debug, Clone, PartialEq)]
24052#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24054pub struct PARAM_REQUEST_READ_DATA {
24055 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24056 pub param_index: i16,
24057 #[doc = "System ID"]
24058 pub target_system: u8,
24059 #[doc = "Component ID"]
24060 pub target_component: u8,
24061 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24062 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24063 pub param_id: [u8; 16],
24064}
24065impl PARAM_REQUEST_READ_DATA {
24066 pub const ENCODED_LEN: usize = 20usize;
24067 pub const DEFAULT: Self = Self {
24068 param_index: 0_i16,
24069 target_system: 0_u8,
24070 target_component: 0_u8,
24071 param_id: [0_u8; 16usize],
24072 };
24073 #[cfg(feature = "arbitrary")]
24074 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24075 use arbitrary::{Arbitrary, Unstructured};
24076 let mut buf = [0u8; 1024];
24077 rng.fill_bytes(&mut buf);
24078 let mut unstructured = Unstructured::new(&buf);
24079 Self::arbitrary(&mut unstructured).unwrap_or_default()
24080 }
24081}
24082impl Default for PARAM_REQUEST_READ_DATA {
24083 fn default() -> Self {
24084 Self::DEFAULT.clone()
24085 }
24086}
24087impl MessageData for PARAM_REQUEST_READ_DATA {
24088 type Message = MavMessage;
24089 const ID: u32 = 20u32;
24090 const NAME: &'static str = "PARAM_REQUEST_READ";
24091 const EXTRA_CRC: u8 = 214u8;
24092 const ENCODED_LEN: usize = 20usize;
24093 fn deser(
24094 _version: MavlinkVersion,
24095 __input: &[u8],
24096 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24097 let avail_len = __input.len();
24098 let mut payload_buf = [0; Self::ENCODED_LEN];
24099 let mut buf = if avail_len < Self::ENCODED_LEN {
24100 payload_buf[0..avail_len].copy_from_slice(__input);
24101 Bytes::new(&payload_buf)
24102 } else {
24103 Bytes::new(__input)
24104 };
24105 let mut __struct = Self::default();
24106 __struct.param_index = buf.get_i16_le();
24107 __struct.target_system = buf.get_u8();
24108 __struct.target_component = buf.get_u8();
24109 for v in &mut __struct.param_id {
24110 let val = buf.get_u8();
24111 *v = val;
24112 }
24113 Ok(__struct)
24114 }
24115 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24116 let mut __tmp = BytesMut::new(bytes);
24117 #[allow(clippy::absurd_extreme_comparisons)]
24118 #[allow(unused_comparisons)]
24119 if __tmp.remaining() < Self::ENCODED_LEN {
24120 panic!(
24121 "buffer is too small (need {} bytes, but got {})",
24122 Self::ENCODED_LEN,
24123 __tmp.remaining(),
24124 )
24125 }
24126 __tmp.put_i16_le(self.param_index);
24127 __tmp.put_u8(self.target_system);
24128 __tmp.put_u8(self.target_component);
24129 for val in &self.param_id {
24130 __tmp.put_u8(*val);
24131 }
24132 if matches!(version, MavlinkVersion::V2) {
24133 let len = __tmp.len();
24134 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24135 } else {
24136 __tmp.len()
24137 }
24138 }
24139}
24140#[doc = "id: 23"]
24141#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24142#[derive(Debug, Clone, PartialEq)]
24143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24145pub struct PARAM_SET_DATA {
24146 #[doc = "Onboard parameter value"]
24147 pub param_value: f32,
24148 #[doc = "System ID"]
24149 pub target_system: u8,
24150 #[doc = "Component ID"]
24151 pub target_component: u8,
24152 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24153 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24154 pub param_id: [u8; 16],
24155 #[doc = "Onboard parameter type."]
24156 pub param_type: MavParamType,
24157}
24158impl PARAM_SET_DATA {
24159 pub const ENCODED_LEN: usize = 23usize;
24160 pub const DEFAULT: Self = Self {
24161 param_value: 0.0_f32,
24162 target_system: 0_u8,
24163 target_component: 0_u8,
24164 param_id: [0_u8; 16usize],
24165 param_type: MavParamType::DEFAULT,
24166 };
24167 #[cfg(feature = "arbitrary")]
24168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24169 use arbitrary::{Arbitrary, Unstructured};
24170 let mut buf = [0u8; 1024];
24171 rng.fill_bytes(&mut buf);
24172 let mut unstructured = Unstructured::new(&buf);
24173 Self::arbitrary(&mut unstructured).unwrap_or_default()
24174 }
24175}
24176impl Default for PARAM_SET_DATA {
24177 fn default() -> Self {
24178 Self::DEFAULT.clone()
24179 }
24180}
24181impl MessageData for PARAM_SET_DATA {
24182 type Message = MavMessage;
24183 const ID: u32 = 23u32;
24184 const NAME: &'static str = "PARAM_SET";
24185 const EXTRA_CRC: u8 = 168u8;
24186 const ENCODED_LEN: usize = 23usize;
24187 fn deser(
24188 _version: MavlinkVersion,
24189 __input: &[u8],
24190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24191 let avail_len = __input.len();
24192 let mut payload_buf = [0; Self::ENCODED_LEN];
24193 let mut buf = if avail_len < Self::ENCODED_LEN {
24194 payload_buf[0..avail_len].copy_from_slice(__input);
24195 Bytes::new(&payload_buf)
24196 } else {
24197 Bytes::new(__input)
24198 };
24199 let mut __struct = Self::default();
24200 __struct.param_value = buf.get_f32_le();
24201 __struct.target_system = buf.get_u8();
24202 __struct.target_component = buf.get_u8();
24203 for v in &mut __struct.param_id {
24204 let val = buf.get_u8();
24205 *v = val;
24206 }
24207 let tmp = buf.get_u8();
24208 __struct.param_type =
24209 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24210 enum_type: "MavParamType",
24211 value: tmp as u32,
24212 })?;
24213 Ok(__struct)
24214 }
24215 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24216 let mut __tmp = BytesMut::new(bytes);
24217 #[allow(clippy::absurd_extreme_comparisons)]
24218 #[allow(unused_comparisons)]
24219 if __tmp.remaining() < Self::ENCODED_LEN {
24220 panic!(
24221 "buffer is too small (need {} bytes, but got {})",
24222 Self::ENCODED_LEN,
24223 __tmp.remaining(),
24224 )
24225 }
24226 __tmp.put_f32_le(self.param_value);
24227 __tmp.put_u8(self.target_system);
24228 __tmp.put_u8(self.target_component);
24229 for val in &self.param_id {
24230 __tmp.put_u8(*val);
24231 }
24232 __tmp.put_u8(self.param_type as u8);
24233 if matches!(version, MavlinkVersion::V2) {
24234 let len = __tmp.len();
24235 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24236 } else {
24237 __tmp.len()
24238 }
24239 }
24240}
24241#[doc = "id: 22"]
24242#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24243#[derive(Debug, Clone, PartialEq)]
24244#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24245#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24246pub struct PARAM_VALUE_DATA {
24247 #[doc = "Onboard parameter value"]
24248 pub param_value: f32,
24249 #[doc = "Total number of onboard parameters"]
24250 pub param_count: u16,
24251 #[doc = "Index of this onboard parameter"]
24252 pub param_index: u16,
24253 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24254 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24255 pub param_id: [u8; 16],
24256 #[doc = "Onboard parameter type."]
24257 pub param_type: MavParamType,
24258}
24259impl PARAM_VALUE_DATA {
24260 pub const ENCODED_LEN: usize = 25usize;
24261 pub const DEFAULT: Self = Self {
24262 param_value: 0.0_f32,
24263 param_count: 0_u16,
24264 param_index: 0_u16,
24265 param_id: [0_u8; 16usize],
24266 param_type: MavParamType::DEFAULT,
24267 };
24268 #[cfg(feature = "arbitrary")]
24269 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24270 use arbitrary::{Arbitrary, Unstructured};
24271 let mut buf = [0u8; 1024];
24272 rng.fill_bytes(&mut buf);
24273 let mut unstructured = Unstructured::new(&buf);
24274 Self::arbitrary(&mut unstructured).unwrap_or_default()
24275 }
24276}
24277impl Default for PARAM_VALUE_DATA {
24278 fn default() -> Self {
24279 Self::DEFAULT.clone()
24280 }
24281}
24282impl MessageData for PARAM_VALUE_DATA {
24283 type Message = MavMessage;
24284 const ID: u32 = 22u32;
24285 const NAME: &'static str = "PARAM_VALUE";
24286 const EXTRA_CRC: u8 = 220u8;
24287 const ENCODED_LEN: usize = 25usize;
24288 fn deser(
24289 _version: MavlinkVersion,
24290 __input: &[u8],
24291 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24292 let avail_len = __input.len();
24293 let mut payload_buf = [0; Self::ENCODED_LEN];
24294 let mut buf = if avail_len < Self::ENCODED_LEN {
24295 payload_buf[0..avail_len].copy_from_slice(__input);
24296 Bytes::new(&payload_buf)
24297 } else {
24298 Bytes::new(__input)
24299 };
24300 let mut __struct = Self::default();
24301 __struct.param_value = buf.get_f32_le();
24302 __struct.param_count = buf.get_u16_le();
24303 __struct.param_index = buf.get_u16_le();
24304 for v in &mut __struct.param_id {
24305 let val = buf.get_u8();
24306 *v = val;
24307 }
24308 let tmp = buf.get_u8();
24309 __struct.param_type =
24310 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24311 enum_type: "MavParamType",
24312 value: tmp as u32,
24313 })?;
24314 Ok(__struct)
24315 }
24316 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24317 let mut __tmp = BytesMut::new(bytes);
24318 #[allow(clippy::absurd_extreme_comparisons)]
24319 #[allow(unused_comparisons)]
24320 if __tmp.remaining() < Self::ENCODED_LEN {
24321 panic!(
24322 "buffer is too small (need {} bytes, but got {})",
24323 Self::ENCODED_LEN,
24324 __tmp.remaining(),
24325 )
24326 }
24327 __tmp.put_f32_le(self.param_value);
24328 __tmp.put_u16_le(self.param_count);
24329 __tmp.put_u16_le(self.param_index);
24330 for val in &self.param_id {
24331 __tmp.put_u8(*val);
24332 }
24333 __tmp.put_u8(self.param_type as u8);
24334 if matches!(version, MavlinkVersion::V2) {
24335 let len = __tmp.len();
24336 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24337 } else {
24338 __tmp.len()
24339 }
24340 }
24341}
24342#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24343#[doc = "id: 4"]
24344#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24345#[derive(Debug, Clone, PartialEq)]
24346#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24347#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24348pub struct PING_DATA {
24349 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24350 pub time_usec: u64,
24351 #[doc = "PING sequence"]
24352 pub seq: u32,
24353 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24354 pub target_system: u8,
24355 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24356 pub target_component: u8,
24357}
24358impl PING_DATA {
24359 pub const ENCODED_LEN: usize = 14usize;
24360 pub const DEFAULT: Self = Self {
24361 time_usec: 0_u64,
24362 seq: 0_u32,
24363 target_system: 0_u8,
24364 target_component: 0_u8,
24365 };
24366 #[cfg(feature = "arbitrary")]
24367 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24368 use arbitrary::{Arbitrary, Unstructured};
24369 let mut buf = [0u8; 1024];
24370 rng.fill_bytes(&mut buf);
24371 let mut unstructured = Unstructured::new(&buf);
24372 Self::arbitrary(&mut unstructured).unwrap_or_default()
24373 }
24374}
24375impl Default for PING_DATA {
24376 fn default() -> Self {
24377 Self::DEFAULT.clone()
24378 }
24379}
24380impl MessageData for PING_DATA {
24381 type Message = MavMessage;
24382 const ID: u32 = 4u32;
24383 const NAME: &'static str = "PING";
24384 const EXTRA_CRC: u8 = 237u8;
24385 const ENCODED_LEN: usize = 14usize;
24386 fn deser(
24387 _version: MavlinkVersion,
24388 __input: &[u8],
24389 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24390 let avail_len = __input.len();
24391 let mut payload_buf = [0; Self::ENCODED_LEN];
24392 let mut buf = if avail_len < Self::ENCODED_LEN {
24393 payload_buf[0..avail_len].copy_from_slice(__input);
24394 Bytes::new(&payload_buf)
24395 } else {
24396 Bytes::new(__input)
24397 };
24398 let mut __struct = Self::default();
24399 __struct.time_usec = buf.get_u64_le();
24400 __struct.seq = buf.get_u32_le();
24401 __struct.target_system = buf.get_u8();
24402 __struct.target_component = buf.get_u8();
24403 Ok(__struct)
24404 }
24405 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24406 let mut __tmp = BytesMut::new(bytes);
24407 #[allow(clippy::absurd_extreme_comparisons)]
24408 #[allow(unused_comparisons)]
24409 if __tmp.remaining() < Self::ENCODED_LEN {
24410 panic!(
24411 "buffer is too small (need {} bytes, but got {})",
24412 Self::ENCODED_LEN,
24413 __tmp.remaining(),
24414 )
24415 }
24416 __tmp.put_u64_le(self.time_usec);
24417 __tmp.put_u32_le(self.seq);
24418 __tmp.put_u8(self.target_system);
24419 __tmp.put_u8(self.target_component);
24420 if matches!(version, MavlinkVersion::V2) {
24421 let len = __tmp.len();
24422 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24423 } else {
24424 __tmp.len()
24425 }
24426 }
24427}
24428#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24429#[doc = "id: 258"]
24430#[doc = "Control vehicle tone generation (buzzer)."]
24431#[derive(Debug, Clone, PartialEq)]
24432#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24433#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24434pub struct PLAY_TUNE_DATA {
24435 #[doc = "System ID"]
24436 pub target_system: u8,
24437 #[doc = "Component ID"]
24438 pub target_component: u8,
24439 #[doc = "tune in board specific format"]
24440 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24441 pub tune: [u8; 30],
24442 #[doc = "tune extension (appended to tune)"]
24443 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24444 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24445 pub tune2: [u8; 200],
24446}
24447impl PLAY_TUNE_DATA {
24448 pub const ENCODED_LEN: usize = 232usize;
24449 pub const DEFAULT: Self = Self {
24450 target_system: 0_u8,
24451 target_component: 0_u8,
24452 tune: [0_u8; 30usize],
24453 tune2: [0_u8; 200usize],
24454 };
24455 #[cfg(feature = "arbitrary")]
24456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24457 use arbitrary::{Arbitrary, Unstructured};
24458 let mut buf = [0u8; 1024];
24459 rng.fill_bytes(&mut buf);
24460 let mut unstructured = Unstructured::new(&buf);
24461 Self::arbitrary(&mut unstructured).unwrap_or_default()
24462 }
24463}
24464impl Default for PLAY_TUNE_DATA {
24465 fn default() -> Self {
24466 Self::DEFAULT.clone()
24467 }
24468}
24469impl MessageData for PLAY_TUNE_DATA {
24470 type Message = MavMessage;
24471 const ID: u32 = 258u32;
24472 const NAME: &'static str = "PLAY_TUNE";
24473 const EXTRA_CRC: u8 = 187u8;
24474 const ENCODED_LEN: usize = 232usize;
24475 fn deser(
24476 _version: MavlinkVersion,
24477 __input: &[u8],
24478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24479 let avail_len = __input.len();
24480 let mut payload_buf = [0; Self::ENCODED_LEN];
24481 let mut buf = if avail_len < Self::ENCODED_LEN {
24482 payload_buf[0..avail_len].copy_from_slice(__input);
24483 Bytes::new(&payload_buf)
24484 } else {
24485 Bytes::new(__input)
24486 };
24487 let mut __struct = Self::default();
24488 __struct.target_system = buf.get_u8();
24489 __struct.target_component = buf.get_u8();
24490 for v in &mut __struct.tune {
24491 let val = buf.get_u8();
24492 *v = val;
24493 }
24494 for v in &mut __struct.tune2 {
24495 let val = buf.get_u8();
24496 *v = val;
24497 }
24498 Ok(__struct)
24499 }
24500 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24501 let mut __tmp = BytesMut::new(bytes);
24502 #[allow(clippy::absurd_extreme_comparisons)]
24503 #[allow(unused_comparisons)]
24504 if __tmp.remaining() < Self::ENCODED_LEN {
24505 panic!(
24506 "buffer is too small (need {} bytes, but got {})",
24507 Self::ENCODED_LEN,
24508 __tmp.remaining(),
24509 )
24510 }
24511 __tmp.put_u8(self.target_system);
24512 __tmp.put_u8(self.target_component);
24513 for val in &self.tune {
24514 __tmp.put_u8(*val);
24515 }
24516 for val in &self.tune2 {
24517 __tmp.put_u8(*val);
24518 }
24519 if matches!(version, MavlinkVersion::V2) {
24520 let len = __tmp.len();
24521 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24522 } else {
24523 __tmp.len()
24524 }
24525 }
24526}
24527#[doc = "id: 400"]
24528#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24529#[derive(Debug, Clone, PartialEq)]
24530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24532pub struct PLAY_TUNE_V2_DATA {
24533 #[doc = "Tune format"]
24534 pub format: TuneFormat,
24535 #[doc = "System ID"]
24536 pub target_system: u8,
24537 #[doc = "Component ID"]
24538 pub target_component: u8,
24539 #[doc = "Tune definition as a NULL-terminated string."]
24540 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24541 pub tune: [u8; 248],
24542}
24543impl PLAY_TUNE_V2_DATA {
24544 pub const ENCODED_LEN: usize = 254usize;
24545 pub const DEFAULT: Self = Self {
24546 format: TuneFormat::DEFAULT,
24547 target_system: 0_u8,
24548 target_component: 0_u8,
24549 tune: [0_u8; 248usize],
24550 };
24551 #[cfg(feature = "arbitrary")]
24552 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24553 use arbitrary::{Arbitrary, Unstructured};
24554 let mut buf = [0u8; 1024];
24555 rng.fill_bytes(&mut buf);
24556 let mut unstructured = Unstructured::new(&buf);
24557 Self::arbitrary(&mut unstructured).unwrap_or_default()
24558 }
24559}
24560impl Default for PLAY_TUNE_V2_DATA {
24561 fn default() -> Self {
24562 Self::DEFAULT.clone()
24563 }
24564}
24565impl MessageData for PLAY_TUNE_V2_DATA {
24566 type Message = MavMessage;
24567 const ID: u32 = 400u32;
24568 const NAME: &'static str = "PLAY_TUNE_V2";
24569 const EXTRA_CRC: u8 = 110u8;
24570 const ENCODED_LEN: usize = 254usize;
24571 fn deser(
24572 _version: MavlinkVersion,
24573 __input: &[u8],
24574 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24575 let avail_len = __input.len();
24576 let mut payload_buf = [0; Self::ENCODED_LEN];
24577 let mut buf = if avail_len < Self::ENCODED_LEN {
24578 payload_buf[0..avail_len].copy_from_slice(__input);
24579 Bytes::new(&payload_buf)
24580 } else {
24581 Bytes::new(__input)
24582 };
24583 let mut __struct = Self::default();
24584 let tmp = buf.get_u32_le();
24585 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24586 ::mavlink_core::error::ParserError::InvalidEnum {
24587 enum_type: "TuneFormat",
24588 value: tmp as u32,
24589 },
24590 )?;
24591 __struct.target_system = buf.get_u8();
24592 __struct.target_component = buf.get_u8();
24593 for v in &mut __struct.tune {
24594 let val = buf.get_u8();
24595 *v = val;
24596 }
24597 Ok(__struct)
24598 }
24599 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24600 let mut __tmp = BytesMut::new(bytes);
24601 #[allow(clippy::absurd_extreme_comparisons)]
24602 #[allow(unused_comparisons)]
24603 if __tmp.remaining() < Self::ENCODED_LEN {
24604 panic!(
24605 "buffer is too small (need {} bytes, but got {})",
24606 Self::ENCODED_LEN,
24607 __tmp.remaining(),
24608 )
24609 }
24610 __tmp.put_u32_le(self.format as u32);
24611 __tmp.put_u8(self.target_system);
24612 __tmp.put_u8(self.target_component);
24613 for val in &self.tune {
24614 __tmp.put_u8(*val);
24615 }
24616 if matches!(version, MavlinkVersion::V2) {
24617 let len = __tmp.len();
24618 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24619 } else {
24620 __tmp.len()
24621 }
24622 }
24623}
24624#[doc = "id: 87"]
24625#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24626#[derive(Debug, Clone, PartialEq)]
24627#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24629pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24630 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24631 pub time_boot_ms: u32,
24632 #[doc = "Latitude in WGS84 frame"]
24633 pub lat_int: i32,
24634 #[doc = "Longitude in WGS84 frame"]
24635 pub lon_int: i32,
24636 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24637 pub alt: f32,
24638 #[doc = "X velocity in NED frame"]
24639 pub vx: f32,
24640 #[doc = "Y velocity in NED frame"]
24641 pub vy: f32,
24642 #[doc = "Z velocity in NED frame"]
24643 pub vz: f32,
24644 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24645 pub afx: f32,
24646 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24647 pub afy: f32,
24648 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24649 pub afz: f32,
24650 #[doc = "yaw setpoint"]
24651 pub yaw: f32,
24652 #[doc = "yaw rate setpoint"]
24653 pub yaw_rate: f32,
24654 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24655 pub type_mask: PositionTargetTypemask,
24656 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24657 pub coordinate_frame: MavFrame,
24658}
24659impl POSITION_TARGET_GLOBAL_INT_DATA {
24660 pub const ENCODED_LEN: usize = 51usize;
24661 pub const DEFAULT: Self = Self {
24662 time_boot_ms: 0_u32,
24663 lat_int: 0_i32,
24664 lon_int: 0_i32,
24665 alt: 0.0_f32,
24666 vx: 0.0_f32,
24667 vy: 0.0_f32,
24668 vz: 0.0_f32,
24669 afx: 0.0_f32,
24670 afy: 0.0_f32,
24671 afz: 0.0_f32,
24672 yaw: 0.0_f32,
24673 yaw_rate: 0.0_f32,
24674 type_mask: PositionTargetTypemask::DEFAULT,
24675 coordinate_frame: MavFrame::DEFAULT,
24676 };
24677 #[cfg(feature = "arbitrary")]
24678 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24679 use arbitrary::{Arbitrary, Unstructured};
24680 let mut buf = [0u8; 1024];
24681 rng.fill_bytes(&mut buf);
24682 let mut unstructured = Unstructured::new(&buf);
24683 Self::arbitrary(&mut unstructured).unwrap_or_default()
24684 }
24685}
24686impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24687 fn default() -> Self {
24688 Self::DEFAULT.clone()
24689 }
24690}
24691impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24692 type Message = MavMessage;
24693 const ID: u32 = 87u32;
24694 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24695 const EXTRA_CRC: u8 = 150u8;
24696 const ENCODED_LEN: usize = 51usize;
24697 fn deser(
24698 _version: MavlinkVersion,
24699 __input: &[u8],
24700 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24701 let avail_len = __input.len();
24702 let mut payload_buf = [0; Self::ENCODED_LEN];
24703 let mut buf = if avail_len < Self::ENCODED_LEN {
24704 payload_buf[0..avail_len].copy_from_slice(__input);
24705 Bytes::new(&payload_buf)
24706 } else {
24707 Bytes::new(__input)
24708 };
24709 let mut __struct = Self::default();
24710 __struct.time_boot_ms = buf.get_u32_le();
24711 __struct.lat_int = buf.get_i32_le();
24712 __struct.lon_int = buf.get_i32_le();
24713 __struct.alt = buf.get_f32_le();
24714 __struct.vx = buf.get_f32_le();
24715 __struct.vy = buf.get_f32_le();
24716 __struct.vz = buf.get_f32_le();
24717 __struct.afx = buf.get_f32_le();
24718 __struct.afy = buf.get_f32_le();
24719 __struct.afz = buf.get_f32_le();
24720 __struct.yaw = buf.get_f32_le();
24721 __struct.yaw_rate = buf.get_f32_le();
24722 let tmp = buf.get_u16_le();
24723 __struct.type_mask = PositionTargetTypemask::from_bits(
24724 tmp & PositionTargetTypemask::all().bits(),
24725 )
24726 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24727 flag_type: "PositionTargetTypemask",
24728 value: tmp as u32,
24729 })?;
24730 let tmp = buf.get_u8();
24731 __struct.coordinate_frame =
24732 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24733 enum_type: "MavFrame",
24734 value: tmp as u32,
24735 })?;
24736 Ok(__struct)
24737 }
24738 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24739 let mut __tmp = BytesMut::new(bytes);
24740 #[allow(clippy::absurd_extreme_comparisons)]
24741 #[allow(unused_comparisons)]
24742 if __tmp.remaining() < Self::ENCODED_LEN {
24743 panic!(
24744 "buffer is too small (need {} bytes, but got {})",
24745 Self::ENCODED_LEN,
24746 __tmp.remaining(),
24747 )
24748 }
24749 __tmp.put_u32_le(self.time_boot_ms);
24750 __tmp.put_i32_le(self.lat_int);
24751 __tmp.put_i32_le(self.lon_int);
24752 __tmp.put_f32_le(self.alt);
24753 __tmp.put_f32_le(self.vx);
24754 __tmp.put_f32_le(self.vy);
24755 __tmp.put_f32_le(self.vz);
24756 __tmp.put_f32_le(self.afx);
24757 __tmp.put_f32_le(self.afy);
24758 __tmp.put_f32_le(self.afz);
24759 __tmp.put_f32_le(self.yaw);
24760 __tmp.put_f32_le(self.yaw_rate);
24761 __tmp.put_u16_le(self.type_mask.bits());
24762 __tmp.put_u8(self.coordinate_frame as u8);
24763 if matches!(version, MavlinkVersion::V2) {
24764 let len = __tmp.len();
24765 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24766 } else {
24767 __tmp.len()
24768 }
24769 }
24770}
24771#[doc = "id: 85"]
24772#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24773#[derive(Debug, Clone, PartialEq)]
24774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24776pub struct POSITION_TARGET_LOCAL_NED_DATA {
24777 #[doc = "Timestamp (time since system boot)."]
24778 pub time_boot_ms: u32,
24779 #[doc = "X Position in NED frame"]
24780 pub x: f32,
24781 #[doc = "Y Position in NED frame"]
24782 pub y: f32,
24783 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24784 pub z: f32,
24785 #[doc = "X velocity in NED frame"]
24786 pub vx: f32,
24787 #[doc = "Y velocity in NED frame"]
24788 pub vy: f32,
24789 #[doc = "Z velocity in NED frame"]
24790 pub vz: f32,
24791 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24792 pub afx: f32,
24793 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24794 pub afy: f32,
24795 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24796 pub afz: f32,
24797 #[doc = "yaw setpoint"]
24798 pub yaw: f32,
24799 #[doc = "yaw rate setpoint"]
24800 pub yaw_rate: f32,
24801 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24802 pub type_mask: PositionTargetTypemask,
24803 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24804 pub coordinate_frame: MavFrame,
24805}
24806impl POSITION_TARGET_LOCAL_NED_DATA {
24807 pub const ENCODED_LEN: usize = 51usize;
24808 pub const DEFAULT: Self = Self {
24809 time_boot_ms: 0_u32,
24810 x: 0.0_f32,
24811 y: 0.0_f32,
24812 z: 0.0_f32,
24813 vx: 0.0_f32,
24814 vy: 0.0_f32,
24815 vz: 0.0_f32,
24816 afx: 0.0_f32,
24817 afy: 0.0_f32,
24818 afz: 0.0_f32,
24819 yaw: 0.0_f32,
24820 yaw_rate: 0.0_f32,
24821 type_mask: PositionTargetTypemask::DEFAULT,
24822 coordinate_frame: MavFrame::DEFAULT,
24823 };
24824 #[cfg(feature = "arbitrary")]
24825 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24826 use arbitrary::{Arbitrary, Unstructured};
24827 let mut buf = [0u8; 1024];
24828 rng.fill_bytes(&mut buf);
24829 let mut unstructured = Unstructured::new(&buf);
24830 Self::arbitrary(&mut unstructured).unwrap_or_default()
24831 }
24832}
24833impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24834 fn default() -> Self {
24835 Self::DEFAULT.clone()
24836 }
24837}
24838impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24839 type Message = MavMessage;
24840 const ID: u32 = 85u32;
24841 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24842 const EXTRA_CRC: u8 = 140u8;
24843 const ENCODED_LEN: usize = 51usize;
24844 fn deser(
24845 _version: MavlinkVersion,
24846 __input: &[u8],
24847 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24848 let avail_len = __input.len();
24849 let mut payload_buf = [0; Self::ENCODED_LEN];
24850 let mut buf = if avail_len < Self::ENCODED_LEN {
24851 payload_buf[0..avail_len].copy_from_slice(__input);
24852 Bytes::new(&payload_buf)
24853 } else {
24854 Bytes::new(__input)
24855 };
24856 let mut __struct = Self::default();
24857 __struct.time_boot_ms = buf.get_u32_le();
24858 __struct.x = buf.get_f32_le();
24859 __struct.y = buf.get_f32_le();
24860 __struct.z = buf.get_f32_le();
24861 __struct.vx = buf.get_f32_le();
24862 __struct.vy = buf.get_f32_le();
24863 __struct.vz = buf.get_f32_le();
24864 __struct.afx = buf.get_f32_le();
24865 __struct.afy = buf.get_f32_le();
24866 __struct.afz = buf.get_f32_le();
24867 __struct.yaw = buf.get_f32_le();
24868 __struct.yaw_rate = buf.get_f32_le();
24869 let tmp = buf.get_u16_le();
24870 __struct.type_mask = PositionTargetTypemask::from_bits(
24871 tmp & PositionTargetTypemask::all().bits(),
24872 )
24873 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24874 flag_type: "PositionTargetTypemask",
24875 value: tmp as u32,
24876 })?;
24877 let tmp = buf.get_u8();
24878 __struct.coordinate_frame =
24879 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24880 enum_type: "MavFrame",
24881 value: tmp as u32,
24882 })?;
24883 Ok(__struct)
24884 }
24885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24886 let mut __tmp = BytesMut::new(bytes);
24887 #[allow(clippy::absurd_extreme_comparisons)]
24888 #[allow(unused_comparisons)]
24889 if __tmp.remaining() < Self::ENCODED_LEN {
24890 panic!(
24891 "buffer is too small (need {} bytes, but got {})",
24892 Self::ENCODED_LEN,
24893 __tmp.remaining(),
24894 )
24895 }
24896 __tmp.put_u32_le(self.time_boot_ms);
24897 __tmp.put_f32_le(self.x);
24898 __tmp.put_f32_le(self.y);
24899 __tmp.put_f32_le(self.z);
24900 __tmp.put_f32_le(self.vx);
24901 __tmp.put_f32_le(self.vy);
24902 __tmp.put_f32_le(self.vz);
24903 __tmp.put_f32_le(self.afx);
24904 __tmp.put_f32_le(self.afy);
24905 __tmp.put_f32_le(self.afz);
24906 __tmp.put_f32_le(self.yaw);
24907 __tmp.put_f32_le(self.yaw_rate);
24908 __tmp.put_u16_le(self.type_mask.bits());
24909 __tmp.put_u8(self.coordinate_frame as u8);
24910 if matches!(version, MavlinkVersion::V2) {
24911 let len = __tmp.len();
24912 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24913 } else {
24914 __tmp.len()
24915 }
24916 }
24917}
24918#[doc = "id: 125"]
24919#[doc = "Power supply status."]
24920#[derive(Debug, Clone, PartialEq)]
24921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24923pub struct POWER_STATUS_DATA {
24924 #[doc = "5V rail voltage."]
24925 pub Vcc: u16,
24926 #[doc = "Servo rail voltage."]
24927 pub Vservo: u16,
24928 #[doc = "Bitmap of power supply status flags."]
24929 pub flags: MavPowerStatus,
24930}
24931impl POWER_STATUS_DATA {
24932 pub const ENCODED_LEN: usize = 6usize;
24933 pub const DEFAULT: Self = Self {
24934 Vcc: 0_u16,
24935 Vservo: 0_u16,
24936 flags: MavPowerStatus::DEFAULT,
24937 };
24938 #[cfg(feature = "arbitrary")]
24939 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24940 use arbitrary::{Arbitrary, Unstructured};
24941 let mut buf = [0u8; 1024];
24942 rng.fill_bytes(&mut buf);
24943 let mut unstructured = Unstructured::new(&buf);
24944 Self::arbitrary(&mut unstructured).unwrap_or_default()
24945 }
24946}
24947impl Default for POWER_STATUS_DATA {
24948 fn default() -> Self {
24949 Self::DEFAULT.clone()
24950 }
24951}
24952impl MessageData for POWER_STATUS_DATA {
24953 type Message = MavMessage;
24954 const ID: u32 = 125u32;
24955 const NAME: &'static str = "POWER_STATUS";
24956 const EXTRA_CRC: u8 = 203u8;
24957 const ENCODED_LEN: usize = 6usize;
24958 fn deser(
24959 _version: MavlinkVersion,
24960 __input: &[u8],
24961 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24962 let avail_len = __input.len();
24963 let mut payload_buf = [0; Self::ENCODED_LEN];
24964 let mut buf = if avail_len < Self::ENCODED_LEN {
24965 payload_buf[0..avail_len].copy_from_slice(__input);
24966 Bytes::new(&payload_buf)
24967 } else {
24968 Bytes::new(__input)
24969 };
24970 let mut __struct = Self::default();
24971 __struct.Vcc = buf.get_u16_le();
24972 __struct.Vservo = buf.get_u16_le();
24973 let tmp = buf.get_u16_le();
24974 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
24975 ::mavlink_core::error::ParserError::InvalidFlag {
24976 flag_type: "MavPowerStatus",
24977 value: tmp as u32,
24978 },
24979 )?;
24980 Ok(__struct)
24981 }
24982 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24983 let mut __tmp = BytesMut::new(bytes);
24984 #[allow(clippy::absurd_extreme_comparisons)]
24985 #[allow(unused_comparisons)]
24986 if __tmp.remaining() < Self::ENCODED_LEN {
24987 panic!(
24988 "buffer is too small (need {} bytes, but got {})",
24989 Self::ENCODED_LEN,
24990 __tmp.remaining(),
24991 )
24992 }
24993 __tmp.put_u16_le(self.Vcc);
24994 __tmp.put_u16_le(self.Vservo);
24995 __tmp.put_u16_le(self.flags.bits());
24996 if matches!(version, MavlinkVersion::V2) {
24997 let len = __tmp.len();
24998 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24999 } else {
25000 __tmp.len()
25001 }
25002 }
25003}
25004#[doc = "id: 300"]
25005#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25006#[derive(Debug, Clone, PartialEq)]
25007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25008#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25009pub struct PROTOCOL_VERSION_DATA {
25010 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25011 pub version: u16,
25012 #[doc = "Minimum MAVLink version supported"]
25013 pub min_version: u16,
25014 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25015 pub max_version: u16,
25016 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25017 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25018 pub spec_version_hash: [u8; 8],
25019 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25020 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25021 pub library_version_hash: [u8; 8],
25022}
25023impl PROTOCOL_VERSION_DATA {
25024 pub const ENCODED_LEN: usize = 22usize;
25025 pub const DEFAULT: Self = Self {
25026 version: 0_u16,
25027 min_version: 0_u16,
25028 max_version: 0_u16,
25029 spec_version_hash: [0_u8; 8usize],
25030 library_version_hash: [0_u8; 8usize],
25031 };
25032 #[cfg(feature = "arbitrary")]
25033 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25034 use arbitrary::{Arbitrary, Unstructured};
25035 let mut buf = [0u8; 1024];
25036 rng.fill_bytes(&mut buf);
25037 let mut unstructured = Unstructured::new(&buf);
25038 Self::arbitrary(&mut unstructured).unwrap_or_default()
25039 }
25040}
25041impl Default for PROTOCOL_VERSION_DATA {
25042 fn default() -> Self {
25043 Self::DEFAULT.clone()
25044 }
25045}
25046impl MessageData for PROTOCOL_VERSION_DATA {
25047 type Message = MavMessage;
25048 const ID: u32 = 300u32;
25049 const NAME: &'static str = "PROTOCOL_VERSION";
25050 const EXTRA_CRC: u8 = 217u8;
25051 const ENCODED_LEN: usize = 22usize;
25052 fn deser(
25053 _version: MavlinkVersion,
25054 __input: &[u8],
25055 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25056 let avail_len = __input.len();
25057 let mut payload_buf = [0; Self::ENCODED_LEN];
25058 let mut buf = if avail_len < Self::ENCODED_LEN {
25059 payload_buf[0..avail_len].copy_from_slice(__input);
25060 Bytes::new(&payload_buf)
25061 } else {
25062 Bytes::new(__input)
25063 };
25064 let mut __struct = Self::default();
25065 __struct.version = buf.get_u16_le();
25066 __struct.min_version = buf.get_u16_le();
25067 __struct.max_version = buf.get_u16_le();
25068 for v in &mut __struct.spec_version_hash {
25069 let val = buf.get_u8();
25070 *v = val;
25071 }
25072 for v in &mut __struct.library_version_hash {
25073 let val = buf.get_u8();
25074 *v = val;
25075 }
25076 Ok(__struct)
25077 }
25078 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25079 let mut __tmp = BytesMut::new(bytes);
25080 #[allow(clippy::absurd_extreme_comparisons)]
25081 #[allow(unused_comparisons)]
25082 if __tmp.remaining() < Self::ENCODED_LEN {
25083 panic!(
25084 "buffer is too small (need {} bytes, but got {})",
25085 Self::ENCODED_LEN,
25086 __tmp.remaining(),
25087 )
25088 }
25089 __tmp.put_u16_le(self.version);
25090 __tmp.put_u16_le(self.min_version);
25091 __tmp.put_u16_le(self.max_version);
25092 for val in &self.spec_version_hash {
25093 __tmp.put_u8(*val);
25094 }
25095 for val in &self.library_version_hash {
25096 __tmp.put_u8(*val);
25097 }
25098 if matches!(version, MavlinkVersion::V2) {
25099 let len = __tmp.len();
25100 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25101 } else {
25102 __tmp.len()
25103 }
25104 }
25105}
25106#[doc = "id: 109"]
25107#[doc = "Status generated by radio and injected into MAVLink stream."]
25108#[derive(Debug, Clone, PartialEq)]
25109#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25111pub struct RADIO_STATUS_DATA {
25112 #[doc = "Count of radio packet receive errors (since boot)."]
25113 pub rxerrors: u16,
25114 #[doc = "Count of error corrected radio packets (since boot)."]
25115 pub fixed: u16,
25116 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25117 pub rssi: u8,
25118 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25119 pub remrssi: u8,
25120 #[doc = "Remaining free transmitter buffer space."]
25121 pub txbuf: u8,
25122 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25123 pub noise: u8,
25124 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25125 pub remnoise: u8,
25126}
25127impl RADIO_STATUS_DATA {
25128 pub const ENCODED_LEN: usize = 9usize;
25129 pub const DEFAULT: Self = Self {
25130 rxerrors: 0_u16,
25131 fixed: 0_u16,
25132 rssi: 0_u8,
25133 remrssi: 0_u8,
25134 txbuf: 0_u8,
25135 noise: 0_u8,
25136 remnoise: 0_u8,
25137 };
25138 #[cfg(feature = "arbitrary")]
25139 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25140 use arbitrary::{Arbitrary, Unstructured};
25141 let mut buf = [0u8; 1024];
25142 rng.fill_bytes(&mut buf);
25143 let mut unstructured = Unstructured::new(&buf);
25144 Self::arbitrary(&mut unstructured).unwrap_or_default()
25145 }
25146}
25147impl Default for RADIO_STATUS_DATA {
25148 fn default() -> Self {
25149 Self::DEFAULT.clone()
25150 }
25151}
25152impl MessageData for RADIO_STATUS_DATA {
25153 type Message = MavMessage;
25154 const ID: u32 = 109u32;
25155 const NAME: &'static str = "RADIO_STATUS";
25156 const EXTRA_CRC: u8 = 185u8;
25157 const ENCODED_LEN: usize = 9usize;
25158 fn deser(
25159 _version: MavlinkVersion,
25160 __input: &[u8],
25161 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25162 let avail_len = __input.len();
25163 let mut payload_buf = [0; Self::ENCODED_LEN];
25164 let mut buf = if avail_len < Self::ENCODED_LEN {
25165 payload_buf[0..avail_len].copy_from_slice(__input);
25166 Bytes::new(&payload_buf)
25167 } else {
25168 Bytes::new(__input)
25169 };
25170 let mut __struct = Self::default();
25171 __struct.rxerrors = buf.get_u16_le();
25172 __struct.fixed = buf.get_u16_le();
25173 __struct.rssi = buf.get_u8();
25174 __struct.remrssi = buf.get_u8();
25175 __struct.txbuf = buf.get_u8();
25176 __struct.noise = buf.get_u8();
25177 __struct.remnoise = buf.get_u8();
25178 Ok(__struct)
25179 }
25180 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25181 let mut __tmp = BytesMut::new(bytes);
25182 #[allow(clippy::absurd_extreme_comparisons)]
25183 #[allow(unused_comparisons)]
25184 if __tmp.remaining() < Self::ENCODED_LEN {
25185 panic!(
25186 "buffer is too small (need {} bytes, but got {})",
25187 Self::ENCODED_LEN,
25188 __tmp.remaining(),
25189 )
25190 }
25191 __tmp.put_u16_le(self.rxerrors);
25192 __tmp.put_u16_le(self.fixed);
25193 __tmp.put_u8(self.rssi);
25194 __tmp.put_u8(self.remrssi);
25195 __tmp.put_u8(self.txbuf);
25196 __tmp.put_u8(self.noise);
25197 __tmp.put_u8(self.remnoise);
25198 if matches!(version, MavlinkVersion::V2) {
25199 let len = __tmp.len();
25200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25201 } else {
25202 __tmp.len()
25203 }
25204 }
25205}
25206#[doc = "id: 27"]
25207#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25208#[derive(Debug, Clone, PartialEq)]
25209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25211pub struct RAW_IMU_DATA {
25212 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25213 pub time_usec: u64,
25214 #[doc = "X acceleration (raw)"]
25215 pub xacc: i16,
25216 #[doc = "Y acceleration (raw)"]
25217 pub yacc: i16,
25218 #[doc = "Z acceleration (raw)"]
25219 pub zacc: i16,
25220 #[doc = "Angular speed around X axis (raw)"]
25221 pub xgyro: i16,
25222 #[doc = "Angular speed around Y axis (raw)"]
25223 pub ygyro: i16,
25224 #[doc = "Angular speed around Z axis (raw)"]
25225 pub zgyro: i16,
25226 #[doc = "X Magnetic field (raw)"]
25227 pub xmag: i16,
25228 #[doc = "Y Magnetic field (raw)"]
25229 pub ymag: i16,
25230 #[doc = "Z Magnetic field (raw)"]
25231 pub zmag: i16,
25232 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25233 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25234 pub id: u8,
25235 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25236 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25237 pub temperature: i16,
25238}
25239impl RAW_IMU_DATA {
25240 pub const ENCODED_LEN: usize = 29usize;
25241 pub const DEFAULT: Self = Self {
25242 time_usec: 0_u64,
25243 xacc: 0_i16,
25244 yacc: 0_i16,
25245 zacc: 0_i16,
25246 xgyro: 0_i16,
25247 ygyro: 0_i16,
25248 zgyro: 0_i16,
25249 xmag: 0_i16,
25250 ymag: 0_i16,
25251 zmag: 0_i16,
25252 id: 0_u8,
25253 temperature: 0_i16,
25254 };
25255 #[cfg(feature = "arbitrary")]
25256 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25257 use arbitrary::{Arbitrary, Unstructured};
25258 let mut buf = [0u8; 1024];
25259 rng.fill_bytes(&mut buf);
25260 let mut unstructured = Unstructured::new(&buf);
25261 Self::arbitrary(&mut unstructured).unwrap_or_default()
25262 }
25263}
25264impl Default for RAW_IMU_DATA {
25265 fn default() -> Self {
25266 Self::DEFAULT.clone()
25267 }
25268}
25269impl MessageData for RAW_IMU_DATA {
25270 type Message = MavMessage;
25271 const ID: u32 = 27u32;
25272 const NAME: &'static str = "RAW_IMU";
25273 const EXTRA_CRC: u8 = 144u8;
25274 const ENCODED_LEN: usize = 29usize;
25275 fn deser(
25276 _version: MavlinkVersion,
25277 __input: &[u8],
25278 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25279 let avail_len = __input.len();
25280 let mut payload_buf = [0; Self::ENCODED_LEN];
25281 let mut buf = if avail_len < Self::ENCODED_LEN {
25282 payload_buf[0..avail_len].copy_from_slice(__input);
25283 Bytes::new(&payload_buf)
25284 } else {
25285 Bytes::new(__input)
25286 };
25287 let mut __struct = Self::default();
25288 __struct.time_usec = buf.get_u64_le();
25289 __struct.xacc = buf.get_i16_le();
25290 __struct.yacc = buf.get_i16_le();
25291 __struct.zacc = buf.get_i16_le();
25292 __struct.xgyro = buf.get_i16_le();
25293 __struct.ygyro = buf.get_i16_le();
25294 __struct.zgyro = buf.get_i16_le();
25295 __struct.xmag = buf.get_i16_le();
25296 __struct.ymag = buf.get_i16_le();
25297 __struct.zmag = buf.get_i16_le();
25298 __struct.id = buf.get_u8();
25299 __struct.temperature = buf.get_i16_le();
25300 Ok(__struct)
25301 }
25302 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25303 let mut __tmp = BytesMut::new(bytes);
25304 #[allow(clippy::absurd_extreme_comparisons)]
25305 #[allow(unused_comparisons)]
25306 if __tmp.remaining() < Self::ENCODED_LEN {
25307 panic!(
25308 "buffer is too small (need {} bytes, but got {})",
25309 Self::ENCODED_LEN,
25310 __tmp.remaining(),
25311 )
25312 }
25313 __tmp.put_u64_le(self.time_usec);
25314 __tmp.put_i16_le(self.xacc);
25315 __tmp.put_i16_le(self.yacc);
25316 __tmp.put_i16_le(self.zacc);
25317 __tmp.put_i16_le(self.xgyro);
25318 __tmp.put_i16_le(self.ygyro);
25319 __tmp.put_i16_le(self.zgyro);
25320 __tmp.put_i16_le(self.xmag);
25321 __tmp.put_i16_le(self.ymag);
25322 __tmp.put_i16_le(self.zmag);
25323 __tmp.put_u8(self.id);
25324 __tmp.put_i16_le(self.temperature);
25325 if matches!(version, MavlinkVersion::V2) {
25326 let len = __tmp.len();
25327 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25328 } else {
25329 __tmp.len()
25330 }
25331 }
25332}
25333#[doc = "id: 28"]
25334#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25335#[derive(Debug, Clone, PartialEq)]
25336#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25337#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25338pub struct RAW_PRESSURE_DATA {
25339 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25340 pub time_usec: u64,
25341 #[doc = "Absolute pressure (raw)"]
25342 pub press_abs: i16,
25343 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25344 pub press_diff1: i16,
25345 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25346 pub press_diff2: i16,
25347 #[doc = "Raw Temperature measurement (raw)"]
25348 pub temperature: i16,
25349}
25350impl RAW_PRESSURE_DATA {
25351 pub const ENCODED_LEN: usize = 16usize;
25352 pub const DEFAULT: Self = Self {
25353 time_usec: 0_u64,
25354 press_abs: 0_i16,
25355 press_diff1: 0_i16,
25356 press_diff2: 0_i16,
25357 temperature: 0_i16,
25358 };
25359 #[cfg(feature = "arbitrary")]
25360 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25361 use arbitrary::{Arbitrary, Unstructured};
25362 let mut buf = [0u8; 1024];
25363 rng.fill_bytes(&mut buf);
25364 let mut unstructured = Unstructured::new(&buf);
25365 Self::arbitrary(&mut unstructured).unwrap_or_default()
25366 }
25367}
25368impl Default for RAW_PRESSURE_DATA {
25369 fn default() -> Self {
25370 Self::DEFAULT.clone()
25371 }
25372}
25373impl MessageData for RAW_PRESSURE_DATA {
25374 type Message = MavMessage;
25375 const ID: u32 = 28u32;
25376 const NAME: &'static str = "RAW_PRESSURE";
25377 const EXTRA_CRC: u8 = 67u8;
25378 const ENCODED_LEN: usize = 16usize;
25379 fn deser(
25380 _version: MavlinkVersion,
25381 __input: &[u8],
25382 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25383 let avail_len = __input.len();
25384 let mut payload_buf = [0; Self::ENCODED_LEN];
25385 let mut buf = if avail_len < Self::ENCODED_LEN {
25386 payload_buf[0..avail_len].copy_from_slice(__input);
25387 Bytes::new(&payload_buf)
25388 } else {
25389 Bytes::new(__input)
25390 };
25391 let mut __struct = Self::default();
25392 __struct.time_usec = buf.get_u64_le();
25393 __struct.press_abs = buf.get_i16_le();
25394 __struct.press_diff1 = buf.get_i16_le();
25395 __struct.press_diff2 = buf.get_i16_le();
25396 __struct.temperature = buf.get_i16_le();
25397 Ok(__struct)
25398 }
25399 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25400 let mut __tmp = BytesMut::new(bytes);
25401 #[allow(clippy::absurd_extreme_comparisons)]
25402 #[allow(unused_comparisons)]
25403 if __tmp.remaining() < Self::ENCODED_LEN {
25404 panic!(
25405 "buffer is too small (need {} bytes, but got {})",
25406 Self::ENCODED_LEN,
25407 __tmp.remaining(),
25408 )
25409 }
25410 __tmp.put_u64_le(self.time_usec);
25411 __tmp.put_i16_le(self.press_abs);
25412 __tmp.put_i16_le(self.press_diff1);
25413 __tmp.put_i16_le(self.press_diff2);
25414 __tmp.put_i16_le(self.temperature);
25415 if matches!(version, MavlinkVersion::V2) {
25416 let len = __tmp.len();
25417 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25418 } else {
25419 __tmp.len()
25420 }
25421 }
25422}
25423#[doc = "id: 339"]
25424#[doc = "RPM sensor data message."]
25425#[derive(Debug, Clone, PartialEq)]
25426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25428pub struct RAW_RPM_DATA {
25429 #[doc = "Indicated rate"]
25430 pub frequency: f32,
25431 #[doc = "Index of this RPM sensor (0-indexed)"]
25432 pub index: u8,
25433}
25434impl RAW_RPM_DATA {
25435 pub const ENCODED_LEN: usize = 5usize;
25436 pub const DEFAULT: Self = Self {
25437 frequency: 0.0_f32,
25438 index: 0_u8,
25439 };
25440 #[cfg(feature = "arbitrary")]
25441 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25442 use arbitrary::{Arbitrary, Unstructured};
25443 let mut buf = [0u8; 1024];
25444 rng.fill_bytes(&mut buf);
25445 let mut unstructured = Unstructured::new(&buf);
25446 Self::arbitrary(&mut unstructured).unwrap_or_default()
25447 }
25448}
25449impl Default for RAW_RPM_DATA {
25450 fn default() -> Self {
25451 Self::DEFAULT.clone()
25452 }
25453}
25454impl MessageData for RAW_RPM_DATA {
25455 type Message = MavMessage;
25456 const ID: u32 = 339u32;
25457 const NAME: &'static str = "RAW_RPM";
25458 const EXTRA_CRC: u8 = 199u8;
25459 const ENCODED_LEN: usize = 5usize;
25460 fn deser(
25461 _version: MavlinkVersion,
25462 __input: &[u8],
25463 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25464 let avail_len = __input.len();
25465 let mut payload_buf = [0; Self::ENCODED_LEN];
25466 let mut buf = if avail_len < Self::ENCODED_LEN {
25467 payload_buf[0..avail_len].copy_from_slice(__input);
25468 Bytes::new(&payload_buf)
25469 } else {
25470 Bytes::new(__input)
25471 };
25472 let mut __struct = Self::default();
25473 __struct.frequency = buf.get_f32_le();
25474 __struct.index = buf.get_u8();
25475 Ok(__struct)
25476 }
25477 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25478 let mut __tmp = BytesMut::new(bytes);
25479 #[allow(clippy::absurd_extreme_comparisons)]
25480 #[allow(unused_comparisons)]
25481 if __tmp.remaining() < Self::ENCODED_LEN {
25482 panic!(
25483 "buffer is too small (need {} bytes, but got {})",
25484 Self::ENCODED_LEN,
25485 __tmp.remaining(),
25486 )
25487 }
25488 __tmp.put_f32_le(self.frequency);
25489 __tmp.put_u8(self.index);
25490 if matches!(version, MavlinkVersion::V2) {
25491 let len = __tmp.len();
25492 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25493 } else {
25494 __tmp.len()
25495 }
25496 }
25497}
25498#[doc = "id: 65"]
25499#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25500#[derive(Debug, Clone, PartialEq)]
25501#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25502#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25503pub struct RC_CHANNELS_DATA {
25504 #[doc = "Timestamp (time since system boot)."]
25505 pub time_boot_ms: u32,
25506 #[doc = "RC channel 1 value."]
25507 pub chan1_raw: u16,
25508 #[doc = "RC channel 2 value."]
25509 pub chan2_raw: u16,
25510 #[doc = "RC channel 3 value."]
25511 pub chan3_raw: u16,
25512 #[doc = "RC channel 4 value."]
25513 pub chan4_raw: u16,
25514 #[doc = "RC channel 5 value."]
25515 pub chan5_raw: u16,
25516 #[doc = "RC channel 6 value."]
25517 pub chan6_raw: u16,
25518 #[doc = "RC channel 7 value."]
25519 pub chan7_raw: u16,
25520 #[doc = "RC channel 8 value."]
25521 pub chan8_raw: u16,
25522 #[doc = "RC channel 9 value."]
25523 pub chan9_raw: u16,
25524 #[doc = "RC channel 10 value."]
25525 pub chan10_raw: u16,
25526 #[doc = "RC channel 11 value."]
25527 pub chan11_raw: u16,
25528 #[doc = "RC channel 12 value."]
25529 pub chan12_raw: u16,
25530 #[doc = "RC channel 13 value."]
25531 pub chan13_raw: u16,
25532 #[doc = "RC channel 14 value."]
25533 pub chan14_raw: u16,
25534 #[doc = "RC channel 15 value."]
25535 pub chan15_raw: u16,
25536 #[doc = "RC channel 16 value."]
25537 pub chan16_raw: u16,
25538 #[doc = "RC channel 17 value."]
25539 pub chan17_raw: u16,
25540 #[doc = "RC channel 18 value."]
25541 pub chan18_raw: u16,
25542 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25543 pub chancount: u8,
25544 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25545 pub rssi: u8,
25546}
25547impl RC_CHANNELS_DATA {
25548 pub const ENCODED_LEN: usize = 42usize;
25549 pub const DEFAULT: Self = Self {
25550 time_boot_ms: 0_u32,
25551 chan1_raw: 0_u16,
25552 chan2_raw: 0_u16,
25553 chan3_raw: 0_u16,
25554 chan4_raw: 0_u16,
25555 chan5_raw: 0_u16,
25556 chan6_raw: 0_u16,
25557 chan7_raw: 0_u16,
25558 chan8_raw: 0_u16,
25559 chan9_raw: 0_u16,
25560 chan10_raw: 0_u16,
25561 chan11_raw: 0_u16,
25562 chan12_raw: 0_u16,
25563 chan13_raw: 0_u16,
25564 chan14_raw: 0_u16,
25565 chan15_raw: 0_u16,
25566 chan16_raw: 0_u16,
25567 chan17_raw: 0_u16,
25568 chan18_raw: 0_u16,
25569 chancount: 0_u8,
25570 rssi: 0_u8,
25571 };
25572 #[cfg(feature = "arbitrary")]
25573 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25574 use arbitrary::{Arbitrary, Unstructured};
25575 let mut buf = [0u8; 1024];
25576 rng.fill_bytes(&mut buf);
25577 let mut unstructured = Unstructured::new(&buf);
25578 Self::arbitrary(&mut unstructured).unwrap_or_default()
25579 }
25580}
25581impl Default for RC_CHANNELS_DATA {
25582 fn default() -> Self {
25583 Self::DEFAULT.clone()
25584 }
25585}
25586impl MessageData for RC_CHANNELS_DATA {
25587 type Message = MavMessage;
25588 const ID: u32 = 65u32;
25589 const NAME: &'static str = "RC_CHANNELS";
25590 const EXTRA_CRC: u8 = 118u8;
25591 const ENCODED_LEN: usize = 42usize;
25592 fn deser(
25593 _version: MavlinkVersion,
25594 __input: &[u8],
25595 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25596 let avail_len = __input.len();
25597 let mut payload_buf = [0; Self::ENCODED_LEN];
25598 let mut buf = if avail_len < Self::ENCODED_LEN {
25599 payload_buf[0..avail_len].copy_from_slice(__input);
25600 Bytes::new(&payload_buf)
25601 } else {
25602 Bytes::new(__input)
25603 };
25604 let mut __struct = Self::default();
25605 __struct.time_boot_ms = buf.get_u32_le();
25606 __struct.chan1_raw = buf.get_u16_le();
25607 __struct.chan2_raw = buf.get_u16_le();
25608 __struct.chan3_raw = buf.get_u16_le();
25609 __struct.chan4_raw = buf.get_u16_le();
25610 __struct.chan5_raw = buf.get_u16_le();
25611 __struct.chan6_raw = buf.get_u16_le();
25612 __struct.chan7_raw = buf.get_u16_le();
25613 __struct.chan8_raw = buf.get_u16_le();
25614 __struct.chan9_raw = buf.get_u16_le();
25615 __struct.chan10_raw = buf.get_u16_le();
25616 __struct.chan11_raw = buf.get_u16_le();
25617 __struct.chan12_raw = buf.get_u16_le();
25618 __struct.chan13_raw = buf.get_u16_le();
25619 __struct.chan14_raw = buf.get_u16_le();
25620 __struct.chan15_raw = buf.get_u16_le();
25621 __struct.chan16_raw = buf.get_u16_le();
25622 __struct.chan17_raw = buf.get_u16_le();
25623 __struct.chan18_raw = buf.get_u16_le();
25624 __struct.chancount = buf.get_u8();
25625 __struct.rssi = buf.get_u8();
25626 Ok(__struct)
25627 }
25628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25629 let mut __tmp = BytesMut::new(bytes);
25630 #[allow(clippy::absurd_extreme_comparisons)]
25631 #[allow(unused_comparisons)]
25632 if __tmp.remaining() < Self::ENCODED_LEN {
25633 panic!(
25634 "buffer is too small (need {} bytes, but got {})",
25635 Self::ENCODED_LEN,
25636 __tmp.remaining(),
25637 )
25638 }
25639 __tmp.put_u32_le(self.time_boot_ms);
25640 __tmp.put_u16_le(self.chan1_raw);
25641 __tmp.put_u16_le(self.chan2_raw);
25642 __tmp.put_u16_le(self.chan3_raw);
25643 __tmp.put_u16_le(self.chan4_raw);
25644 __tmp.put_u16_le(self.chan5_raw);
25645 __tmp.put_u16_le(self.chan6_raw);
25646 __tmp.put_u16_le(self.chan7_raw);
25647 __tmp.put_u16_le(self.chan8_raw);
25648 __tmp.put_u16_le(self.chan9_raw);
25649 __tmp.put_u16_le(self.chan10_raw);
25650 __tmp.put_u16_le(self.chan11_raw);
25651 __tmp.put_u16_le(self.chan12_raw);
25652 __tmp.put_u16_le(self.chan13_raw);
25653 __tmp.put_u16_le(self.chan14_raw);
25654 __tmp.put_u16_le(self.chan15_raw);
25655 __tmp.put_u16_le(self.chan16_raw);
25656 __tmp.put_u16_le(self.chan17_raw);
25657 __tmp.put_u16_le(self.chan18_raw);
25658 __tmp.put_u8(self.chancount);
25659 __tmp.put_u8(self.rssi);
25660 if matches!(version, MavlinkVersion::V2) {
25661 let len = __tmp.len();
25662 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25663 } else {
25664 __tmp.len()
25665 }
25666 }
25667}
25668#[doc = "id: 70"]
25669#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25670#[derive(Debug, Clone, PartialEq)]
25671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25673pub struct RC_CHANNELS_OVERRIDE_DATA {
25674 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25675 pub chan1_raw: u16,
25676 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25677 pub chan2_raw: u16,
25678 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25679 pub chan3_raw: u16,
25680 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25681 pub chan4_raw: u16,
25682 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25683 pub chan5_raw: u16,
25684 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25685 pub chan6_raw: u16,
25686 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25687 pub chan7_raw: u16,
25688 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25689 pub chan8_raw: u16,
25690 #[doc = "System ID"]
25691 pub target_system: u8,
25692 #[doc = "Component ID"]
25693 pub target_component: u8,
25694 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25695 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25696 pub chan9_raw: u16,
25697 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25698 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25699 pub chan10_raw: u16,
25700 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25701 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25702 pub chan11_raw: u16,
25703 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25704 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25705 pub chan12_raw: u16,
25706 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25707 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25708 pub chan13_raw: u16,
25709 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25710 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25711 pub chan14_raw: u16,
25712 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25713 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25714 pub chan15_raw: u16,
25715 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25716 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25717 pub chan16_raw: u16,
25718 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25719 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25720 pub chan17_raw: u16,
25721 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25722 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25723 pub chan18_raw: u16,
25724}
25725impl RC_CHANNELS_OVERRIDE_DATA {
25726 pub const ENCODED_LEN: usize = 38usize;
25727 pub const DEFAULT: Self = Self {
25728 chan1_raw: 0_u16,
25729 chan2_raw: 0_u16,
25730 chan3_raw: 0_u16,
25731 chan4_raw: 0_u16,
25732 chan5_raw: 0_u16,
25733 chan6_raw: 0_u16,
25734 chan7_raw: 0_u16,
25735 chan8_raw: 0_u16,
25736 target_system: 0_u8,
25737 target_component: 0_u8,
25738 chan9_raw: 0_u16,
25739 chan10_raw: 0_u16,
25740 chan11_raw: 0_u16,
25741 chan12_raw: 0_u16,
25742 chan13_raw: 0_u16,
25743 chan14_raw: 0_u16,
25744 chan15_raw: 0_u16,
25745 chan16_raw: 0_u16,
25746 chan17_raw: 0_u16,
25747 chan18_raw: 0_u16,
25748 };
25749 #[cfg(feature = "arbitrary")]
25750 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25751 use arbitrary::{Arbitrary, Unstructured};
25752 let mut buf = [0u8; 1024];
25753 rng.fill_bytes(&mut buf);
25754 let mut unstructured = Unstructured::new(&buf);
25755 Self::arbitrary(&mut unstructured).unwrap_or_default()
25756 }
25757}
25758impl Default for RC_CHANNELS_OVERRIDE_DATA {
25759 fn default() -> Self {
25760 Self::DEFAULT.clone()
25761 }
25762}
25763impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25764 type Message = MavMessage;
25765 const ID: u32 = 70u32;
25766 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25767 const EXTRA_CRC: u8 = 124u8;
25768 const ENCODED_LEN: usize = 38usize;
25769 fn deser(
25770 _version: MavlinkVersion,
25771 __input: &[u8],
25772 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25773 let avail_len = __input.len();
25774 let mut payload_buf = [0; Self::ENCODED_LEN];
25775 let mut buf = if avail_len < Self::ENCODED_LEN {
25776 payload_buf[0..avail_len].copy_from_slice(__input);
25777 Bytes::new(&payload_buf)
25778 } else {
25779 Bytes::new(__input)
25780 };
25781 let mut __struct = Self::default();
25782 __struct.chan1_raw = buf.get_u16_le();
25783 __struct.chan2_raw = buf.get_u16_le();
25784 __struct.chan3_raw = buf.get_u16_le();
25785 __struct.chan4_raw = buf.get_u16_le();
25786 __struct.chan5_raw = buf.get_u16_le();
25787 __struct.chan6_raw = buf.get_u16_le();
25788 __struct.chan7_raw = buf.get_u16_le();
25789 __struct.chan8_raw = buf.get_u16_le();
25790 __struct.target_system = buf.get_u8();
25791 __struct.target_component = buf.get_u8();
25792 __struct.chan9_raw = buf.get_u16_le();
25793 __struct.chan10_raw = buf.get_u16_le();
25794 __struct.chan11_raw = buf.get_u16_le();
25795 __struct.chan12_raw = buf.get_u16_le();
25796 __struct.chan13_raw = buf.get_u16_le();
25797 __struct.chan14_raw = buf.get_u16_le();
25798 __struct.chan15_raw = buf.get_u16_le();
25799 __struct.chan16_raw = buf.get_u16_le();
25800 __struct.chan17_raw = buf.get_u16_le();
25801 __struct.chan18_raw = buf.get_u16_le();
25802 Ok(__struct)
25803 }
25804 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25805 let mut __tmp = BytesMut::new(bytes);
25806 #[allow(clippy::absurd_extreme_comparisons)]
25807 #[allow(unused_comparisons)]
25808 if __tmp.remaining() < Self::ENCODED_LEN {
25809 panic!(
25810 "buffer is too small (need {} bytes, but got {})",
25811 Self::ENCODED_LEN,
25812 __tmp.remaining(),
25813 )
25814 }
25815 __tmp.put_u16_le(self.chan1_raw);
25816 __tmp.put_u16_le(self.chan2_raw);
25817 __tmp.put_u16_le(self.chan3_raw);
25818 __tmp.put_u16_le(self.chan4_raw);
25819 __tmp.put_u16_le(self.chan5_raw);
25820 __tmp.put_u16_le(self.chan6_raw);
25821 __tmp.put_u16_le(self.chan7_raw);
25822 __tmp.put_u16_le(self.chan8_raw);
25823 __tmp.put_u8(self.target_system);
25824 __tmp.put_u8(self.target_component);
25825 __tmp.put_u16_le(self.chan9_raw);
25826 __tmp.put_u16_le(self.chan10_raw);
25827 __tmp.put_u16_le(self.chan11_raw);
25828 __tmp.put_u16_le(self.chan12_raw);
25829 __tmp.put_u16_le(self.chan13_raw);
25830 __tmp.put_u16_le(self.chan14_raw);
25831 __tmp.put_u16_le(self.chan15_raw);
25832 __tmp.put_u16_le(self.chan16_raw);
25833 __tmp.put_u16_le(self.chan17_raw);
25834 __tmp.put_u16_le(self.chan18_raw);
25835 if matches!(version, MavlinkVersion::V2) {
25836 let len = __tmp.len();
25837 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25838 } else {
25839 __tmp.len()
25840 }
25841 }
25842}
25843#[doc = "id: 35"]
25844#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25845#[derive(Debug, Clone, PartialEq)]
25846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25847#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25848pub struct RC_CHANNELS_RAW_DATA {
25849 #[doc = "Timestamp (time since system boot)."]
25850 pub time_boot_ms: u32,
25851 #[doc = "RC channel 1 value."]
25852 pub chan1_raw: u16,
25853 #[doc = "RC channel 2 value."]
25854 pub chan2_raw: u16,
25855 #[doc = "RC channel 3 value."]
25856 pub chan3_raw: u16,
25857 #[doc = "RC channel 4 value."]
25858 pub chan4_raw: u16,
25859 #[doc = "RC channel 5 value."]
25860 pub chan5_raw: u16,
25861 #[doc = "RC channel 6 value."]
25862 pub chan6_raw: u16,
25863 #[doc = "RC channel 7 value."]
25864 pub chan7_raw: u16,
25865 #[doc = "RC channel 8 value."]
25866 pub chan8_raw: u16,
25867 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25868 pub port: u8,
25869 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25870 pub rssi: u8,
25871}
25872impl RC_CHANNELS_RAW_DATA {
25873 pub const ENCODED_LEN: usize = 22usize;
25874 pub const DEFAULT: Self = Self {
25875 time_boot_ms: 0_u32,
25876 chan1_raw: 0_u16,
25877 chan2_raw: 0_u16,
25878 chan3_raw: 0_u16,
25879 chan4_raw: 0_u16,
25880 chan5_raw: 0_u16,
25881 chan6_raw: 0_u16,
25882 chan7_raw: 0_u16,
25883 chan8_raw: 0_u16,
25884 port: 0_u8,
25885 rssi: 0_u8,
25886 };
25887 #[cfg(feature = "arbitrary")]
25888 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25889 use arbitrary::{Arbitrary, Unstructured};
25890 let mut buf = [0u8; 1024];
25891 rng.fill_bytes(&mut buf);
25892 let mut unstructured = Unstructured::new(&buf);
25893 Self::arbitrary(&mut unstructured).unwrap_or_default()
25894 }
25895}
25896impl Default for RC_CHANNELS_RAW_DATA {
25897 fn default() -> Self {
25898 Self::DEFAULT.clone()
25899 }
25900}
25901impl MessageData for RC_CHANNELS_RAW_DATA {
25902 type Message = MavMessage;
25903 const ID: u32 = 35u32;
25904 const NAME: &'static str = "RC_CHANNELS_RAW";
25905 const EXTRA_CRC: u8 = 244u8;
25906 const ENCODED_LEN: usize = 22usize;
25907 fn deser(
25908 _version: MavlinkVersion,
25909 __input: &[u8],
25910 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25911 let avail_len = __input.len();
25912 let mut payload_buf = [0; Self::ENCODED_LEN];
25913 let mut buf = if avail_len < Self::ENCODED_LEN {
25914 payload_buf[0..avail_len].copy_from_slice(__input);
25915 Bytes::new(&payload_buf)
25916 } else {
25917 Bytes::new(__input)
25918 };
25919 let mut __struct = Self::default();
25920 __struct.time_boot_ms = buf.get_u32_le();
25921 __struct.chan1_raw = buf.get_u16_le();
25922 __struct.chan2_raw = buf.get_u16_le();
25923 __struct.chan3_raw = buf.get_u16_le();
25924 __struct.chan4_raw = buf.get_u16_le();
25925 __struct.chan5_raw = buf.get_u16_le();
25926 __struct.chan6_raw = buf.get_u16_le();
25927 __struct.chan7_raw = buf.get_u16_le();
25928 __struct.chan8_raw = buf.get_u16_le();
25929 __struct.port = buf.get_u8();
25930 __struct.rssi = buf.get_u8();
25931 Ok(__struct)
25932 }
25933 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25934 let mut __tmp = BytesMut::new(bytes);
25935 #[allow(clippy::absurd_extreme_comparisons)]
25936 #[allow(unused_comparisons)]
25937 if __tmp.remaining() < Self::ENCODED_LEN {
25938 panic!(
25939 "buffer is too small (need {} bytes, but got {})",
25940 Self::ENCODED_LEN,
25941 __tmp.remaining(),
25942 )
25943 }
25944 __tmp.put_u32_le(self.time_boot_ms);
25945 __tmp.put_u16_le(self.chan1_raw);
25946 __tmp.put_u16_le(self.chan2_raw);
25947 __tmp.put_u16_le(self.chan3_raw);
25948 __tmp.put_u16_le(self.chan4_raw);
25949 __tmp.put_u16_le(self.chan5_raw);
25950 __tmp.put_u16_le(self.chan6_raw);
25951 __tmp.put_u16_le(self.chan7_raw);
25952 __tmp.put_u16_le(self.chan8_raw);
25953 __tmp.put_u8(self.port);
25954 __tmp.put_u8(self.rssi);
25955 if matches!(version, MavlinkVersion::V2) {
25956 let len = __tmp.len();
25957 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25958 } else {
25959 __tmp.len()
25960 }
25961 }
25962}
25963#[doc = "id: 34"]
25964#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25965#[derive(Debug, Clone, PartialEq)]
25966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25967#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25968pub struct RC_CHANNELS_SCALED_DATA {
25969 #[doc = "Timestamp (time since system boot)."]
25970 pub time_boot_ms: u32,
25971 #[doc = "RC channel 1 value scaled."]
25972 pub chan1_scaled: i16,
25973 #[doc = "RC channel 2 value scaled."]
25974 pub chan2_scaled: i16,
25975 #[doc = "RC channel 3 value scaled."]
25976 pub chan3_scaled: i16,
25977 #[doc = "RC channel 4 value scaled."]
25978 pub chan4_scaled: i16,
25979 #[doc = "RC channel 5 value scaled."]
25980 pub chan5_scaled: i16,
25981 #[doc = "RC channel 6 value scaled."]
25982 pub chan6_scaled: i16,
25983 #[doc = "RC channel 7 value scaled."]
25984 pub chan7_scaled: i16,
25985 #[doc = "RC channel 8 value scaled."]
25986 pub chan8_scaled: i16,
25987 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25988 pub port: u8,
25989 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25990 pub rssi: u8,
25991}
25992impl RC_CHANNELS_SCALED_DATA {
25993 pub const ENCODED_LEN: usize = 22usize;
25994 pub const DEFAULT: Self = Self {
25995 time_boot_ms: 0_u32,
25996 chan1_scaled: 0_i16,
25997 chan2_scaled: 0_i16,
25998 chan3_scaled: 0_i16,
25999 chan4_scaled: 0_i16,
26000 chan5_scaled: 0_i16,
26001 chan6_scaled: 0_i16,
26002 chan7_scaled: 0_i16,
26003 chan8_scaled: 0_i16,
26004 port: 0_u8,
26005 rssi: 0_u8,
26006 };
26007 #[cfg(feature = "arbitrary")]
26008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26009 use arbitrary::{Arbitrary, Unstructured};
26010 let mut buf = [0u8; 1024];
26011 rng.fill_bytes(&mut buf);
26012 let mut unstructured = Unstructured::new(&buf);
26013 Self::arbitrary(&mut unstructured).unwrap_or_default()
26014 }
26015}
26016impl Default for RC_CHANNELS_SCALED_DATA {
26017 fn default() -> Self {
26018 Self::DEFAULT.clone()
26019 }
26020}
26021impl MessageData for RC_CHANNELS_SCALED_DATA {
26022 type Message = MavMessage;
26023 const ID: u32 = 34u32;
26024 const NAME: &'static str = "RC_CHANNELS_SCALED";
26025 const EXTRA_CRC: u8 = 237u8;
26026 const ENCODED_LEN: usize = 22usize;
26027 fn deser(
26028 _version: MavlinkVersion,
26029 __input: &[u8],
26030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26031 let avail_len = __input.len();
26032 let mut payload_buf = [0; Self::ENCODED_LEN];
26033 let mut buf = if avail_len < Self::ENCODED_LEN {
26034 payload_buf[0..avail_len].copy_from_slice(__input);
26035 Bytes::new(&payload_buf)
26036 } else {
26037 Bytes::new(__input)
26038 };
26039 let mut __struct = Self::default();
26040 __struct.time_boot_ms = buf.get_u32_le();
26041 __struct.chan1_scaled = buf.get_i16_le();
26042 __struct.chan2_scaled = buf.get_i16_le();
26043 __struct.chan3_scaled = buf.get_i16_le();
26044 __struct.chan4_scaled = buf.get_i16_le();
26045 __struct.chan5_scaled = buf.get_i16_le();
26046 __struct.chan6_scaled = buf.get_i16_le();
26047 __struct.chan7_scaled = buf.get_i16_le();
26048 __struct.chan8_scaled = buf.get_i16_le();
26049 __struct.port = buf.get_u8();
26050 __struct.rssi = buf.get_u8();
26051 Ok(__struct)
26052 }
26053 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26054 let mut __tmp = BytesMut::new(bytes);
26055 #[allow(clippy::absurd_extreme_comparisons)]
26056 #[allow(unused_comparisons)]
26057 if __tmp.remaining() < Self::ENCODED_LEN {
26058 panic!(
26059 "buffer is too small (need {} bytes, but got {})",
26060 Self::ENCODED_LEN,
26061 __tmp.remaining(),
26062 )
26063 }
26064 __tmp.put_u32_le(self.time_boot_ms);
26065 __tmp.put_i16_le(self.chan1_scaled);
26066 __tmp.put_i16_le(self.chan2_scaled);
26067 __tmp.put_i16_le(self.chan3_scaled);
26068 __tmp.put_i16_le(self.chan4_scaled);
26069 __tmp.put_i16_le(self.chan5_scaled);
26070 __tmp.put_i16_le(self.chan6_scaled);
26071 __tmp.put_i16_le(self.chan7_scaled);
26072 __tmp.put_i16_le(self.chan8_scaled);
26073 __tmp.put_u8(self.port);
26074 __tmp.put_u8(self.rssi);
26075 if matches!(version, MavlinkVersion::V2) {
26076 let len = __tmp.len();
26077 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26078 } else {
26079 __tmp.len()
26080 }
26081 }
26082}
26083#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26084#[doc = "id: 66"]
26085#[doc = "Request a data stream."]
26086#[derive(Debug, Clone, PartialEq)]
26087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26089pub struct REQUEST_DATA_STREAM_DATA {
26090 #[doc = "The requested message rate"]
26091 pub req_message_rate: u16,
26092 #[doc = "The target requested to send the message stream."]
26093 pub target_system: u8,
26094 #[doc = "The target requested to send the message stream."]
26095 pub target_component: u8,
26096 #[doc = "The ID of the requested data stream"]
26097 pub req_stream_id: u8,
26098 #[doc = "1 to start sending, 0 to stop sending."]
26099 pub start_stop: u8,
26100}
26101impl REQUEST_DATA_STREAM_DATA {
26102 pub const ENCODED_LEN: usize = 6usize;
26103 pub const DEFAULT: Self = Self {
26104 req_message_rate: 0_u16,
26105 target_system: 0_u8,
26106 target_component: 0_u8,
26107 req_stream_id: 0_u8,
26108 start_stop: 0_u8,
26109 };
26110 #[cfg(feature = "arbitrary")]
26111 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26112 use arbitrary::{Arbitrary, Unstructured};
26113 let mut buf = [0u8; 1024];
26114 rng.fill_bytes(&mut buf);
26115 let mut unstructured = Unstructured::new(&buf);
26116 Self::arbitrary(&mut unstructured).unwrap_or_default()
26117 }
26118}
26119impl Default for REQUEST_DATA_STREAM_DATA {
26120 fn default() -> Self {
26121 Self::DEFAULT.clone()
26122 }
26123}
26124impl MessageData for REQUEST_DATA_STREAM_DATA {
26125 type Message = MavMessage;
26126 const ID: u32 = 66u32;
26127 const NAME: &'static str = "REQUEST_DATA_STREAM";
26128 const EXTRA_CRC: u8 = 148u8;
26129 const ENCODED_LEN: usize = 6usize;
26130 fn deser(
26131 _version: MavlinkVersion,
26132 __input: &[u8],
26133 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26134 let avail_len = __input.len();
26135 let mut payload_buf = [0; Self::ENCODED_LEN];
26136 let mut buf = if avail_len < Self::ENCODED_LEN {
26137 payload_buf[0..avail_len].copy_from_slice(__input);
26138 Bytes::new(&payload_buf)
26139 } else {
26140 Bytes::new(__input)
26141 };
26142 let mut __struct = Self::default();
26143 __struct.req_message_rate = buf.get_u16_le();
26144 __struct.target_system = buf.get_u8();
26145 __struct.target_component = buf.get_u8();
26146 __struct.req_stream_id = buf.get_u8();
26147 __struct.start_stop = buf.get_u8();
26148 Ok(__struct)
26149 }
26150 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26151 let mut __tmp = BytesMut::new(bytes);
26152 #[allow(clippy::absurd_extreme_comparisons)]
26153 #[allow(unused_comparisons)]
26154 if __tmp.remaining() < Self::ENCODED_LEN {
26155 panic!(
26156 "buffer is too small (need {} bytes, but got {})",
26157 Self::ENCODED_LEN,
26158 __tmp.remaining(),
26159 )
26160 }
26161 __tmp.put_u16_le(self.req_message_rate);
26162 __tmp.put_u8(self.target_system);
26163 __tmp.put_u8(self.target_component);
26164 __tmp.put_u8(self.req_stream_id);
26165 __tmp.put_u8(self.start_stop);
26166 if matches!(version, MavlinkVersion::V2) {
26167 let len = __tmp.len();
26168 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26169 } else {
26170 __tmp.len()
26171 }
26172 }
26173}
26174#[doc = "id: 412"]
26175#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26176#[derive(Debug, Clone, PartialEq)]
26177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26179pub struct REQUEST_EVENT_DATA {
26180 #[doc = "First sequence number of the requested event."]
26181 pub first_sequence: u16,
26182 #[doc = "Last sequence number of the requested event."]
26183 pub last_sequence: u16,
26184 #[doc = "System ID"]
26185 pub target_system: u8,
26186 #[doc = "Component ID"]
26187 pub target_component: u8,
26188}
26189impl REQUEST_EVENT_DATA {
26190 pub const ENCODED_LEN: usize = 6usize;
26191 pub const DEFAULT: Self = Self {
26192 first_sequence: 0_u16,
26193 last_sequence: 0_u16,
26194 target_system: 0_u8,
26195 target_component: 0_u8,
26196 };
26197 #[cfg(feature = "arbitrary")]
26198 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26199 use arbitrary::{Arbitrary, Unstructured};
26200 let mut buf = [0u8; 1024];
26201 rng.fill_bytes(&mut buf);
26202 let mut unstructured = Unstructured::new(&buf);
26203 Self::arbitrary(&mut unstructured).unwrap_or_default()
26204 }
26205}
26206impl Default for REQUEST_EVENT_DATA {
26207 fn default() -> Self {
26208 Self::DEFAULT.clone()
26209 }
26210}
26211impl MessageData for REQUEST_EVENT_DATA {
26212 type Message = MavMessage;
26213 const ID: u32 = 412u32;
26214 const NAME: &'static str = "REQUEST_EVENT";
26215 const EXTRA_CRC: u8 = 33u8;
26216 const ENCODED_LEN: usize = 6usize;
26217 fn deser(
26218 _version: MavlinkVersion,
26219 __input: &[u8],
26220 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26221 let avail_len = __input.len();
26222 let mut payload_buf = [0; Self::ENCODED_LEN];
26223 let mut buf = if avail_len < Self::ENCODED_LEN {
26224 payload_buf[0..avail_len].copy_from_slice(__input);
26225 Bytes::new(&payload_buf)
26226 } else {
26227 Bytes::new(__input)
26228 };
26229 let mut __struct = Self::default();
26230 __struct.first_sequence = buf.get_u16_le();
26231 __struct.last_sequence = buf.get_u16_le();
26232 __struct.target_system = buf.get_u8();
26233 __struct.target_component = buf.get_u8();
26234 Ok(__struct)
26235 }
26236 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26237 let mut __tmp = BytesMut::new(bytes);
26238 #[allow(clippy::absurd_extreme_comparisons)]
26239 #[allow(unused_comparisons)]
26240 if __tmp.remaining() < Self::ENCODED_LEN {
26241 panic!(
26242 "buffer is too small (need {} bytes, but got {})",
26243 Self::ENCODED_LEN,
26244 __tmp.remaining(),
26245 )
26246 }
26247 __tmp.put_u16_le(self.first_sequence);
26248 __tmp.put_u16_le(self.last_sequence);
26249 __tmp.put_u8(self.target_system);
26250 __tmp.put_u8(self.target_component);
26251 if matches!(version, MavlinkVersion::V2) {
26252 let len = __tmp.len();
26253 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26254 } else {
26255 __tmp.len()
26256 }
26257 }
26258}
26259#[doc = "id: 142"]
26260#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26261#[derive(Debug, Clone, PartialEq)]
26262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26263#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26264pub struct RESOURCE_REQUEST_DATA {
26265 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26266 pub request_id: u8,
26267 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26268 pub uri_type: u8,
26269 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26270 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26271 pub uri: [u8; 120],
26272 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26273 pub transfer_type: u8,
26274 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26275 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26276 pub storage: [u8; 120],
26277}
26278impl RESOURCE_REQUEST_DATA {
26279 pub const ENCODED_LEN: usize = 243usize;
26280 pub const DEFAULT: Self = Self {
26281 request_id: 0_u8,
26282 uri_type: 0_u8,
26283 uri: [0_u8; 120usize],
26284 transfer_type: 0_u8,
26285 storage: [0_u8; 120usize],
26286 };
26287 #[cfg(feature = "arbitrary")]
26288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26289 use arbitrary::{Arbitrary, Unstructured};
26290 let mut buf = [0u8; 1024];
26291 rng.fill_bytes(&mut buf);
26292 let mut unstructured = Unstructured::new(&buf);
26293 Self::arbitrary(&mut unstructured).unwrap_or_default()
26294 }
26295}
26296impl Default for RESOURCE_REQUEST_DATA {
26297 fn default() -> Self {
26298 Self::DEFAULT.clone()
26299 }
26300}
26301impl MessageData for RESOURCE_REQUEST_DATA {
26302 type Message = MavMessage;
26303 const ID: u32 = 142u32;
26304 const NAME: &'static str = "RESOURCE_REQUEST";
26305 const EXTRA_CRC: u8 = 72u8;
26306 const ENCODED_LEN: usize = 243usize;
26307 fn deser(
26308 _version: MavlinkVersion,
26309 __input: &[u8],
26310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26311 let avail_len = __input.len();
26312 let mut payload_buf = [0; Self::ENCODED_LEN];
26313 let mut buf = if avail_len < Self::ENCODED_LEN {
26314 payload_buf[0..avail_len].copy_from_slice(__input);
26315 Bytes::new(&payload_buf)
26316 } else {
26317 Bytes::new(__input)
26318 };
26319 let mut __struct = Self::default();
26320 __struct.request_id = buf.get_u8();
26321 __struct.uri_type = buf.get_u8();
26322 for v in &mut __struct.uri {
26323 let val = buf.get_u8();
26324 *v = val;
26325 }
26326 __struct.transfer_type = buf.get_u8();
26327 for v in &mut __struct.storage {
26328 let val = buf.get_u8();
26329 *v = val;
26330 }
26331 Ok(__struct)
26332 }
26333 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26334 let mut __tmp = BytesMut::new(bytes);
26335 #[allow(clippy::absurd_extreme_comparisons)]
26336 #[allow(unused_comparisons)]
26337 if __tmp.remaining() < Self::ENCODED_LEN {
26338 panic!(
26339 "buffer is too small (need {} bytes, but got {})",
26340 Self::ENCODED_LEN,
26341 __tmp.remaining(),
26342 )
26343 }
26344 __tmp.put_u8(self.request_id);
26345 __tmp.put_u8(self.uri_type);
26346 for val in &self.uri {
26347 __tmp.put_u8(*val);
26348 }
26349 __tmp.put_u8(self.transfer_type);
26350 for val in &self.storage {
26351 __tmp.put_u8(*val);
26352 }
26353 if matches!(version, MavlinkVersion::V2) {
26354 let len = __tmp.len();
26355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26356 } else {
26357 __tmp.len()
26358 }
26359 }
26360}
26361#[doc = "id: 413"]
26362#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26363#[derive(Debug, Clone, PartialEq)]
26364#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26366pub struct RESPONSE_EVENT_ERROR_DATA {
26367 #[doc = "Sequence number."]
26368 pub sequence: u16,
26369 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26370 pub sequence_oldest_available: u16,
26371 #[doc = "System ID"]
26372 pub target_system: u8,
26373 #[doc = "Component ID"]
26374 pub target_component: u8,
26375 #[doc = "Error reason."]
26376 pub reason: MavEventErrorReason,
26377}
26378impl RESPONSE_EVENT_ERROR_DATA {
26379 pub const ENCODED_LEN: usize = 7usize;
26380 pub const DEFAULT: Self = Self {
26381 sequence: 0_u16,
26382 sequence_oldest_available: 0_u16,
26383 target_system: 0_u8,
26384 target_component: 0_u8,
26385 reason: MavEventErrorReason::DEFAULT,
26386 };
26387 #[cfg(feature = "arbitrary")]
26388 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26389 use arbitrary::{Arbitrary, Unstructured};
26390 let mut buf = [0u8; 1024];
26391 rng.fill_bytes(&mut buf);
26392 let mut unstructured = Unstructured::new(&buf);
26393 Self::arbitrary(&mut unstructured).unwrap_or_default()
26394 }
26395}
26396impl Default for RESPONSE_EVENT_ERROR_DATA {
26397 fn default() -> Self {
26398 Self::DEFAULT.clone()
26399 }
26400}
26401impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26402 type Message = MavMessage;
26403 const ID: u32 = 413u32;
26404 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26405 const EXTRA_CRC: u8 = 77u8;
26406 const ENCODED_LEN: usize = 7usize;
26407 fn deser(
26408 _version: MavlinkVersion,
26409 __input: &[u8],
26410 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26411 let avail_len = __input.len();
26412 let mut payload_buf = [0; Self::ENCODED_LEN];
26413 let mut buf = if avail_len < Self::ENCODED_LEN {
26414 payload_buf[0..avail_len].copy_from_slice(__input);
26415 Bytes::new(&payload_buf)
26416 } else {
26417 Bytes::new(__input)
26418 };
26419 let mut __struct = Self::default();
26420 __struct.sequence = buf.get_u16_le();
26421 __struct.sequence_oldest_available = buf.get_u16_le();
26422 __struct.target_system = buf.get_u8();
26423 __struct.target_component = buf.get_u8();
26424 let tmp = buf.get_u8();
26425 __struct.reason =
26426 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26427 enum_type: "MavEventErrorReason",
26428 value: tmp as u32,
26429 })?;
26430 Ok(__struct)
26431 }
26432 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26433 let mut __tmp = BytesMut::new(bytes);
26434 #[allow(clippy::absurd_extreme_comparisons)]
26435 #[allow(unused_comparisons)]
26436 if __tmp.remaining() < Self::ENCODED_LEN {
26437 panic!(
26438 "buffer is too small (need {} bytes, but got {})",
26439 Self::ENCODED_LEN,
26440 __tmp.remaining(),
26441 )
26442 }
26443 __tmp.put_u16_le(self.sequence);
26444 __tmp.put_u16_le(self.sequence_oldest_available);
26445 __tmp.put_u8(self.target_system);
26446 __tmp.put_u8(self.target_component);
26447 __tmp.put_u8(self.reason as u8);
26448 if matches!(version, MavlinkVersion::V2) {
26449 let len = __tmp.len();
26450 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26451 } else {
26452 __tmp.len()
26453 }
26454 }
26455}
26456#[doc = "id: 55"]
26457#[doc = "Read out the safety zone the MAV currently assumes."]
26458#[derive(Debug, Clone, PartialEq)]
26459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26460#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26461pub struct SAFETY_ALLOWED_AREA_DATA {
26462 #[doc = "x position 1 / Latitude 1"]
26463 pub p1x: f32,
26464 #[doc = "y position 1 / Longitude 1"]
26465 pub p1y: f32,
26466 #[doc = "z position 1 / Altitude 1"]
26467 pub p1z: f32,
26468 #[doc = "x position 2 / Latitude 2"]
26469 pub p2x: f32,
26470 #[doc = "y position 2 / Longitude 2"]
26471 pub p2y: f32,
26472 #[doc = "z position 2 / Altitude 2"]
26473 pub p2z: f32,
26474 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26475 pub frame: MavFrame,
26476}
26477impl SAFETY_ALLOWED_AREA_DATA {
26478 pub const ENCODED_LEN: usize = 25usize;
26479 pub const DEFAULT: Self = Self {
26480 p1x: 0.0_f32,
26481 p1y: 0.0_f32,
26482 p1z: 0.0_f32,
26483 p2x: 0.0_f32,
26484 p2y: 0.0_f32,
26485 p2z: 0.0_f32,
26486 frame: MavFrame::DEFAULT,
26487 };
26488 #[cfg(feature = "arbitrary")]
26489 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26490 use arbitrary::{Arbitrary, Unstructured};
26491 let mut buf = [0u8; 1024];
26492 rng.fill_bytes(&mut buf);
26493 let mut unstructured = Unstructured::new(&buf);
26494 Self::arbitrary(&mut unstructured).unwrap_or_default()
26495 }
26496}
26497impl Default for SAFETY_ALLOWED_AREA_DATA {
26498 fn default() -> Self {
26499 Self::DEFAULT.clone()
26500 }
26501}
26502impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26503 type Message = MavMessage;
26504 const ID: u32 = 55u32;
26505 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26506 const EXTRA_CRC: u8 = 3u8;
26507 const ENCODED_LEN: usize = 25usize;
26508 fn deser(
26509 _version: MavlinkVersion,
26510 __input: &[u8],
26511 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26512 let avail_len = __input.len();
26513 let mut payload_buf = [0; Self::ENCODED_LEN];
26514 let mut buf = if avail_len < Self::ENCODED_LEN {
26515 payload_buf[0..avail_len].copy_from_slice(__input);
26516 Bytes::new(&payload_buf)
26517 } else {
26518 Bytes::new(__input)
26519 };
26520 let mut __struct = Self::default();
26521 __struct.p1x = buf.get_f32_le();
26522 __struct.p1y = buf.get_f32_le();
26523 __struct.p1z = buf.get_f32_le();
26524 __struct.p2x = buf.get_f32_le();
26525 __struct.p2y = buf.get_f32_le();
26526 __struct.p2z = buf.get_f32_le();
26527 let tmp = buf.get_u8();
26528 __struct.frame =
26529 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26530 enum_type: "MavFrame",
26531 value: tmp as u32,
26532 })?;
26533 Ok(__struct)
26534 }
26535 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26536 let mut __tmp = BytesMut::new(bytes);
26537 #[allow(clippy::absurd_extreme_comparisons)]
26538 #[allow(unused_comparisons)]
26539 if __tmp.remaining() < Self::ENCODED_LEN {
26540 panic!(
26541 "buffer is too small (need {} bytes, but got {})",
26542 Self::ENCODED_LEN,
26543 __tmp.remaining(),
26544 )
26545 }
26546 __tmp.put_f32_le(self.p1x);
26547 __tmp.put_f32_le(self.p1y);
26548 __tmp.put_f32_le(self.p1z);
26549 __tmp.put_f32_le(self.p2x);
26550 __tmp.put_f32_le(self.p2y);
26551 __tmp.put_f32_le(self.p2z);
26552 __tmp.put_u8(self.frame as u8);
26553 if matches!(version, MavlinkVersion::V2) {
26554 let len = __tmp.len();
26555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26556 } else {
26557 __tmp.len()
26558 }
26559 }
26560}
26561#[doc = "id: 54"]
26562#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26563#[derive(Debug, Clone, PartialEq)]
26564#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26565#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26566pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26567 #[doc = "x position 1 / Latitude 1"]
26568 pub p1x: f32,
26569 #[doc = "y position 1 / Longitude 1"]
26570 pub p1y: f32,
26571 #[doc = "z position 1 / Altitude 1"]
26572 pub p1z: f32,
26573 #[doc = "x position 2 / Latitude 2"]
26574 pub p2x: f32,
26575 #[doc = "y position 2 / Longitude 2"]
26576 pub p2y: f32,
26577 #[doc = "z position 2 / Altitude 2"]
26578 pub p2z: f32,
26579 #[doc = "System ID"]
26580 pub target_system: u8,
26581 #[doc = "Component ID"]
26582 pub target_component: u8,
26583 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26584 pub frame: MavFrame,
26585}
26586impl SAFETY_SET_ALLOWED_AREA_DATA {
26587 pub const ENCODED_LEN: usize = 27usize;
26588 pub const DEFAULT: Self = Self {
26589 p1x: 0.0_f32,
26590 p1y: 0.0_f32,
26591 p1z: 0.0_f32,
26592 p2x: 0.0_f32,
26593 p2y: 0.0_f32,
26594 p2z: 0.0_f32,
26595 target_system: 0_u8,
26596 target_component: 0_u8,
26597 frame: MavFrame::DEFAULT,
26598 };
26599 #[cfg(feature = "arbitrary")]
26600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26601 use arbitrary::{Arbitrary, Unstructured};
26602 let mut buf = [0u8; 1024];
26603 rng.fill_bytes(&mut buf);
26604 let mut unstructured = Unstructured::new(&buf);
26605 Self::arbitrary(&mut unstructured).unwrap_or_default()
26606 }
26607}
26608impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26609 fn default() -> Self {
26610 Self::DEFAULT.clone()
26611 }
26612}
26613impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26614 type Message = MavMessage;
26615 const ID: u32 = 54u32;
26616 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26617 const EXTRA_CRC: u8 = 15u8;
26618 const ENCODED_LEN: usize = 27usize;
26619 fn deser(
26620 _version: MavlinkVersion,
26621 __input: &[u8],
26622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26623 let avail_len = __input.len();
26624 let mut payload_buf = [0; Self::ENCODED_LEN];
26625 let mut buf = if avail_len < Self::ENCODED_LEN {
26626 payload_buf[0..avail_len].copy_from_slice(__input);
26627 Bytes::new(&payload_buf)
26628 } else {
26629 Bytes::new(__input)
26630 };
26631 let mut __struct = Self::default();
26632 __struct.p1x = buf.get_f32_le();
26633 __struct.p1y = buf.get_f32_le();
26634 __struct.p1z = buf.get_f32_le();
26635 __struct.p2x = buf.get_f32_le();
26636 __struct.p2y = buf.get_f32_le();
26637 __struct.p2z = buf.get_f32_le();
26638 __struct.target_system = buf.get_u8();
26639 __struct.target_component = buf.get_u8();
26640 let tmp = buf.get_u8();
26641 __struct.frame =
26642 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26643 enum_type: "MavFrame",
26644 value: tmp as u32,
26645 })?;
26646 Ok(__struct)
26647 }
26648 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26649 let mut __tmp = BytesMut::new(bytes);
26650 #[allow(clippy::absurd_extreme_comparisons)]
26651 #[allow(unused_comparisons)]
26652 if __tmp.remaining() < Self::ENCODED_LEN {
26653 panic!(
26654 "buffer is too small (need {} bytes, but got {})",
26655 Self::ENCODED_LEN,
26656 __tmp.remaining(),
26657 )
26658 }
26659 __tmp.put_f32_le(self.p1x);
26660 __tmp.put_f32_le(self.p1y);
26661 __tmp.put_f32_le(self.p1z);
26662 __tmp.put_f32_le(self.p2x);
26663 __tmp.put_f32_le(self.p2y);
26664 __tmp.put_f32_le(self.p2z);
26665 __tmp.put_u8(self.target_system);
26666 __tmp.put_u8(self.target_component);
26667 __tmp.put_u8(self.frame as u8);
26668 if matches!(version, MavlinkVersion::V2) {
26669 let len = __tmp.len();
26670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26671 } else {
26672 __tmp.len()
26673 }
26674 }
26675}
26676#[doc = "id: 8015"]
26677#[doc = "Status of the SatCom link."]
26678#[derive(Debug, Clone, PartialEq)]
26679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26681pub struct SATCOM_LINK_STATUS_DATA {
26682 #[doc = "Timestamp"]
26683 pub timestamp: u64,
26684 #[doc = "Timestamp of the last successful sbd session"]
26685 pub last_heartbeat: u64,
26686 #[doc = "Number of failed sessions"]
26687 pub failed_sessions: u16,
26688 #[doc = "Number of successful sessions"]
26689 pub successful_sessions: u16,
26690 #[doc = "Signal quality"]
26691 pub signal_quality: u8,
26692 #[doc = "Ring call pending"]
26693 pub ring_pending: u8,
26694 #[doc = "Transmission session pending"]
26695 pub tx_session_pending: u8,
26696 #[doc = "Receiving session pending"]
26697 pub rx_session_pending: u8,
26698}
26699impl SATCOM_LINK_STATUS_DATA {
26700 pub const ENCODED_LEN: usize = 24usize;
26701 pub const DEFAULT: Self = Self {
26702 timestamp: 0_u64,
26703 last_heartbeat: 0_u64,
26704 failed_sessions: 0_u16,
26705 successful_sessions: 0_u16,
26706 signal_quality: 0_u8,
26707 ring_pending: 0_u8,
26708 tx_session_pending: 0_u8,
26709 rx_session_pending: 0_u8,
26710 };
26711 #[cfg(feature = "arbitrary")]
26712 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26713 use arbitrary::{Arbitrary, Unstructured};
26714 let mut buf = [0u8; 1024];
26715 rng.fill_bytes(&mut buf);
26716 let mut unstructured = Unstructured::new(&buf);
26717 Self::arbitrary(&mut unstructured).unwrap_or_default()
26718 }
26719}
26720impl Default for SATCOM_LINK_STATUS_DATA {
26721 fn default() -> Self {
26722 Self::DEFAULT.clone()
26723 }
26724}
26725impl MessageData for SATCOM_LINK_STATUS_DATA {
26726 type Message = MavMessage;
26727 const ID: u32 = 8015u32;
26728 const NAME: &'static str = "SATCOM_LINK_STATUS";
26729 const EXTRA_CRC: u8 = 23u8;
26730 const ENCODED_LEN: usize = 24usize;
26731 fn deser(
26732 _version: MavlinkVersion,
26733 __input: &[u8],
26734 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26735 let avail_len = __input.len();
26736 let mut payload_buf = [0; Self::ENCODED_LEN];
26737 let mut buf = if avail_len < Self::ENCODED_LEN {
26738 payload_buf[0..avail_len].copy_from_slice(__input);
26739 Bytes::new(&payload_buf)
26740 } else {
26741 Bytes::new(__input)
26742 };
26743 let mut __struct = Self::default();
26744 __struct.timestamp = buf.get_u64_le();
26745 __struct.last_heartbeat = buf.get_u64_le();
26746 __struct.failed_sessions = buf.get_u16_le();
26747 __struct.successful_sessions = buf.get_u16_le();
26748 __struct.signal_quality = buf.get_u8();
26749 __struct.ring_pending = buf.get_u8();
26750 __struct.tx_session_pending = buf.get_u8();
26751 __struct.rx_session_pending = buf.get_u8();
26752 Ok(__struct)
26753 }
26754 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26755 let mut __tmp = BytesMut::new(bytes);
26756 #[allow(clippy::absurd_extreme_comparisons)]
26757 #[allow(unused_comparisons)]
26758 if __tmp.remaining() < Self::ENCODED_LEN {
26759 panic!(
26760 "buffer is too small (need {} bytes, but got {})",
26761 Self::ENCODED_LEN,
26762 __tmp.remaining(),
26763 )
26764 }
26765 __tmp.put_u64_le(self.timestamp);
26766 __tmp.put_u64_le(self.last_heartbeat);
26767 __tmp.put_u16_le(self.failed_sessions);
26768 __tmp.put_u16_le(self.successful_sessions);
26769 __tmp.put_u8(self.signal_quality);
26770 __tmp.put_u8(self.ring_pending);
26771 __tmp.put_u8(self.tx_session_pending);
26772 __tmp.put_u8(self.rx_session_pending);
26773 if matches!(version, MavlinkVersion::V2) {
26774 let len = __tmp.len();
26775 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26776 } else {
26777 __tmp.len()
26778 }
26779 }
26780}
26781#[doc = "id: 26"]
26782#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26783#[derive(Debug, Clone, PartialEq)]
26784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26785#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26786pub struct SCALED_IMU_DATA {
26787 #[doc = "Timestamp (time since system boot)."]
26788 pub time_boot_ms: u32,
26789 #[doc = "X acceleration"]
26790 pub xacc: i16,
26791 #[doc = "Y acceleration"]
26792 pub yacc: i16,
26793 #[doc = "Z acceleration"]
26794 pub zacc: i16,
26795 #[doc = "Angular speed around X axis"]
26796 pub xgyro: i16,
26797 #[doc = "Angular speed around Y axis"]
26798 pub ygyro: i16,
26799 #[doc = "Angular speed around Z axis"]
26800 pub zgyro: i16,
26801 #[doc = "X Magnetic field"]
26802 pub xmag: i16,
26803 #[doc = "Y Magnetic field"]
26804 pub ymag: i16,
26805 #[doc = "Z Magnetic field"]
26806 pub zmag: i16,
26807 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26808 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26809 pub temperature: i16,
26810}
26811impl SCALED_IMU_DATA {
26812 pub const ENCODED_LEN: usize = 24usize;
26813 pub const DEFAULT: Self = Self {
26814 time_boot_ms: 0_u32,
26815 xacc: 0_i16,
26816 yacc: 0_i16,
26817 zacc: 0_i16,
26818 xgyro: 0_i16,
26819 ygyro: 0_i16,
26820 zgyro: 0_i16,
26821 xmag: 0_i16,
26822 ymag: 0_i16,
26823 zmag: 0_i16,
26824 temperature: 0_i16,
26825 };
26826 #[cfg(feature = "arbitrary")]
26827 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26828 use arbitrary::{Arbitrary, Unstructured};
26829 let mut buf = [0u8; 1024];
26830 rng.fill_bytes(&mut buf);
26831 let mut unstructured = Unstructured::new(&buf);
26832 Self::arbitrary(&mut unstructured).unwrap_or_default()
26833 }
26834}
26835impl Default for SCALED_IMU_DATA {
26836 fn default() -> Self {
26837 Self::DEFAULT.clone()
26838 }
26839}
26840impl MessageData for SCALED_IMU_DATA {
26841 type Message = MavMessage;
26842 const ID: u32 = 26u32;
26843 const NAME: &'static str = "SCALED_IMU";
26844 const EXTRA_CRC: u8 = 170u8;
26845 const ENCODED_LEN: usize = 24usize;
26846 fn deser(
26847 _version: MavlinkVersion,
26848 __input: &[u8],
26849 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26850 let avail_len = __input.len();
26851 let mut payload_buf = [0; Self::ENCODED_LEN];
26852 let mut buf = if avail_len < Self::ENCODED_LEN {
26853 payload_buf[0..avail_len].copy_from_slice(__input);
26854 Bytes::new(&payload_buf)
26855 } else {
26856 Bytes::new(__input)
26857 };
26858 let mut __struct = Self::default();
26859 __struct.time_boot_ms = buf.get_u32_le();
26860 __struct.xacc = buf.get_i16_le();
26861 __struct.yacc = buf.get_i16_le();
26862 __struct.zacc = buf.get_i16_le();
26863 __struct.xgyro = buf.get_i16_le();
26864 __struct.ygyro = buf.get_i16_le();
26865 __struct.zgyro = buf.get_i16_le();
26866 __struct.xmag = buf.get_i16_le();
26867 __struct.ymag = buf.get_i16_le();
26868 __struct.zmag = buf.get_i16_le();
26869 __struct.temperature = buf.get_i16_le();
26870 Ok(__struct)
26871 }
26872 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26873 let mut __tmp = BytesMut::new(bytes);
26874 #[allow(clippy::absurd_extreme_comparisons)]
26875 #[allow(unused_comparisons)]
26876 if __tmp.remaining() < Self::ENCODED_LEN {
26877 panic!(
26878 "buffer is too small (need {} bytes, but got {})",
26879 Self::ENCODED_LEN,
26880 __tmp.remaining(),
26881 )
26882 }
26883 __tmp.put_u32_le(self.time_boot_ms);
26884 __tmp.put_i16_le(self.xacc);
26885 __tmp.put_i16_le(self.yacc);
26886 __tmp.put_i16_le(self.zacc);
26887 __tmp.put_i16_le(self.xgyro);
26888 __tmp.put_i16_le(self.ygyro);
26889 __tmp.put_i16_le(self.zgyro);
26890 __tmp.put_i16_le(self.xmag);
26891 __tmp.put_i16_le(self.ymag);
26892 __tmp.put_i16_le(self.zmag);
26893 __tmp.put_i16_le(self.temperature);
26894 if matches!(version, MavlinkVersion::V2) {
26895 let len = __tmp.len();
26896 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26897 } else {
26898 __tmp.len()
26899 }
26900 }
26901}
26902#[doc = "id: 116"]
26903#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26904#[derive(Debug, Clone, PartialEq)]
26905#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26907pub struct SCALED_IMU2_DATA {
26908 #[doc = "Timestamp (time since system boot)."]
26909 pub time_boot_ms: u32,
26910 #[doc = "X acceleration"]
26911 pub xacc: i16,
26912 #[doc = "Y acceleration"]
26913 pub yacc: i16,
26914 #[doc = "Z acceleration"]
26915 pub zacc: i16,
26916 #[doc = "Angular speed around X axis"]
26917 pub xgyro: i16,
26918 #[doc = "Angular speed around Y axis"]
26919 pub ygyro: i16,
26920 #[doc = "Angular speed around Z axis"]
26921 pub zgyro: i16,
26922 #[doc = "X Magnetic field"]
26923 pub xmag: i16,
26924 #[doc = "Y Magnetic field"]
26925 pub ymag: i16,
26926 #[doc = "Z Magnetic field"]
26927 pub zmag: i16,
26928 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26929 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26930 pub temperature: i16,
26931}
26932impl SCALED_IMU2_DATA {
26933 pub const ENCODED_LEN: usize = 24usize;
26934 pub const DEFAULT: Self = Self {
26935 time_boot_ms: 0_u32,
26936 xacc: 0_i16,
26937 yacc: 0_i16,
26938 zacc: 0_i16,
26939 xgyro: 0_i16,
26940 ygyro: 0_i16,
26941 zgyro: 0_i16,
26942 xmag: 0_i16,
26943 ymag: 0_i16,
26944 zmag: 0_i16,
26945 temperature: 0_i16,
26946 };
26947 #[cfg(feature = "arbitrary")]
26948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26949 use arbitrary::{Arbitrary, Unstructured};
26950 let mut buf = [0u8; 1024];
26951 rng.fill_bytes(&mut buf);
26952 let mut unstructured = Unstructured::new(&buf);
26953 Self::arbitrary(&mut unstructured).unwrap_or_default()
26954 }
26955}
26956impl Default for SCALED_IMU2_DATA {
26957 fn default() -> Self {
26958 Self::DEFAULT.clone()
26959 }
26960}
26961impl MessageData for SCALED_IMU2_DATA {
26962 type Message = MavMessage;
26963 const ID: u32 = 116u32;
26964 const NAME: &'static str = "SCALED_IMU2";
26965 const EXTRA_CRC: u8 = 76u8;
26966 const ENCODED_LEN: usize = 24usize;
26967 fn deser(
26968 _version: MavlinkVersion,
26969 __input: &[u8],
26970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26971 let avail_len = __input.len();
26972 let mut payload_buf = [0; Self::ENCODED_LEN];
26973 let mut buf = if avail_len < Self::ENCODED_LEN {
26974 payload_buf[0..avail_len].copy_from_slice(__input);
26975 Bytes::new(&payload_buf)
26976 } else {
26977 Bytes::new(__input)
26978 };
26979 let mut __struct = Self::default();
26980 __struct.time_boot_ms = buf.get_u32_le();
26981 __struct.xacc = buf.get_i16_le();
26982 __struct.yacc = buf.get_i16_le();
26983 __struct.zacc = buf.get_i16_le();
26984 __struct.xgyro = buf.get_i16_le();
26985 __struct.ygyro = buf.get_i16_le();
26986 __struct.zgyro = buf.get_i16_le();
26987 __struct.xmag = buf.get_i16_le();
26988 __struct.ymag = buf.get_i16_le();
26989 __struct.zmag = buf.get_i16_le();
26990 __struct.temperature = buf.get_i16_le();
26991 Ok(__struct)
26992 }
26993 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26994 let mut __tmp = BytesMut::new(bytes);
26995 #[allow(clippy::absurd_extreme_comparisons)]
26996 #[allow(unused_comparisons)]
26997 if __tmp.remaining() < Self::ENCODED_LEN {
26998 panic!(
26999 "buffer is too small (need {} bytes, but got {})",
27000 Self::ENCODED_LEN,
27001 __tmp.remaining(),
27002 )
27003 }
27004 __tmp.put_u32_le(self.time_boot_ms);
27005 __tmp.put_i16_le(self.xacc);
27006 __tmp.put_i16_le(self.yacc);
27007 __tmp.put_i16_le(self.zacc);
27008 __tmp.put_i16_le(self.xgyro);
27009 __tmp.put_i16_le(self.ygyro);
27010 __tmp.put_i16_le(self.zgyro);
27011 __tmp.put_i16_le(self.xmag);
27012 __tmp.put_i16_le(self.ymag);
27013 __tmp.put_i16_le(self.zmag);
27014 __tmp.put_i16_le(self.temperature);
27015 if matches!(version, MavlinkVersion::V2) {
27016 let len = __tmp.len();
27017 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27018 } else {
27019 __tmp.len()
27020 }
27021 }
27022}
27023#[doc = "id: 129"]
27024#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27025#[derive(Debug, Clone, PartialEq)]
27026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27028pub struct SCALED_IMU3_DATA {
27029 #[doc = "Timestamp (time since system boot)."]
27030 pub time_boot_ms: u32,
27031 #[doc = "X acceleration"]
27032 pub xacc: i16,
27033 #[doc = "Y acceleration"]
27034 pub yacc: i16,
27035 #[doc = "Z acceleration"]
27036 pub zacc: i16,
27037 #[doc = "Angular speed around X axis"]
27038 pub xgyro: i16,
27039 #[doc = "Angular speed around Y axis"]
27040 pub ygyro: i16,
27041 #[doc = "Angular speed around Z axis"]
27042 pub zgyro: i16,
27043 #[doc = "X Magnetic field"]
27044 pub xmag: i16,
27045 #[doc = "Y Magnetic field"]
27046 pub ymag: i16,
27047 #[doc = "Z Magnetic field"]
27048 pub zmag: i16,
27049 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27050 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27051 pub temperature: i16,
27052}
27053impl SCALED_IMU3_DATA {
27054 pub const ENCODED_LEN: usize = 24usize;
27055 pub const DEFAULT: Self = Self {
27056 time_boot_ms: 0_u32,
27057 xacc: 0_i16,
27058 yacc: 0_i16,
27059 zacc: 0_i16,
27060 xgyro: 0_i16,
27061 ygyro: 0_i16,
27062 zgyro: 0_i16,
27063 xmag: 0_i16,
27064 ymag: 0_i16,
27065 zmag: 0_i16,
27066 temperature: 0_i16,
27067 };
27068 #[cfg(feature = "arbitrary")]
27069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27070 use arbitrary::{Arbitrary, Unstructured};
27071 let mut buf = [0u8; 1024];
27072 rng.fill_bytes(&mut buf);
27073 let mut unstructured = Unstructured::new(&buf);
27074 Self::arbitrary(&mut unstructured).unwrap_or_default()
27075 }
27076}
27077impl Default for SCALED_IMU3_DATA {
27078 fn default() -> Self {
27079 Self::DEFAULT.clone()
27080 }
27081}
27082impl MessageData for SCALED_IMU3_DATA {
27083 type Message = MavMessage;
27084 const ID: u32 = 129u32;
27085 const NAME: &'static str = "SCALED_IMU3";
27086 const EXTRA_CRC: u8 = 46u8;
27087 const ENCODED_LEN: usize = 24usize;
27088 fn deser(
27089 _version: MavlinkVersion,
27090 __input: &[u8],
27091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27092 let avail_len = __input.len();
27093 let mut payload_buf = [0; Self::ENCODED_LEN];
27094 let mut buf = if avail_len < Self::ENCODED_LEN {
27095 payload_buf[0..avail_len].copy_from_slice(__input);
27096 Bytes::new(&payload_buf)
27097 } else {
27098 Bytes::new(__input)
27099 };
27100 let mut __struct = Self::default();
27101 __struct.time_boot_ms = buf.get_u32_le();
27102 __struct.xacc = buf.get_i16_le();
27103 __struct.yacc = buf.get_i16_le();
27104 __struct.zacc = buf.get_i16_le();
27105 __struct.xgyro = buf.get_i16_le();
27106 __struct.ygyro = buf.get_i16_le();
27107 __struct.zgyro = buf.get_i16_le();
27108 __struct.xmag = buf.get_i16_le();
27109 __struct.ymag = buf.get_i16_le();
27110 __struct.zmag = buf.get_i16_le();
27111 __struct.temperature = buf.get_i16_le();
27112 Ok(__struct)
27113 }
27114 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27115 let mut __tmp = BytesMut::new(bytes);
27116 #[allow(clippy::absurd_extreme_comparisons)]
27117 #[allow(unused_comparisons)]
27118 if __tmp.remaining() < Self::ENCODED_LEN {
27119 panic!(
27120 "buffer is too small (need {} bytes, but got {})",
27121 Self::ENCODED_LEN,
27122 __tmp.remaining(),
27123 )
27124 }
27125 __tmp.put_u32_le(self.time_boot_ms);
27126 __tmp.put_i16_le(self.xacc);
27127 __tmp.put_i16_le(self.yacc);
27128 __tmp.put_i16_le(self.zacc);
27129 __tmp.put_i16_le(self.xgyro);
27130 __tmp.put_i16_le(self.ygyro);
27131 __tmp.put_i16_le(self.zgyro);
27132 __tmp.put_i16_le(self.xmag);
27133 __tmp.put_i16_le(self.ymag);
27134 __tmp.put_i16_le(self.zmag);
27135 __tmp.put_i16_le(self.temperature);
27136 if matches!(version, MavlinkVersion::V2) {
27137 let len = __tmp.len();
27138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27139 } else {
27140 __tmp.len()
27141 }
27142 }
27143}
27144#[doc = "id: 29"]
27145#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27146#[derive(Debug, Clone, PartialEq)]
27147#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27149pub struct SCALED_PRESSURE_DATA {
27150 #[doc = "Timestamp (time since system boot)."]
27151 pub time_boot_ms: u32,
27152 #[doc = "Absolute pressure"]
27153 pub press_abs: f32,
27154 #[doc = "Differential pressure 1"]
27155 pub press_diff: f32,
27156 #[doc = "Absolute pressure temperature"]
27157 pub temperature: i16,
27158 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27159 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27160 pub temperature_press_diff: i16,
27161}
27162impl SCALED_PRESSURE_DATA {
27163 pub const ENCODED_LEN: usize = 16usize;
27164 pub const DEFAULT: Self = Self {
27165 time_boot_ms: 0_u32,
27166 press_abs: 0.0_f32,
27167 press_diff: 0.0_f32,
27168 temperature: 0_i16,
27169 temperature_press_diff: 0_i16,
27170 };
27171 #[cfg(feature = "arbitrary")]
27172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27173 use arbitrary::{Arbitrary, Unstructured};
27174 let mut buf = [0u8; 1024];
27175 rng.fill_bytes(&mut buf);
27176 let mut unstructured = Unstructured::new(&buf);
27177 Self::arbitrary(&mut unstructured).unwrap_or_default()
27178 }
27179}
27180impl Default for SCALED_PRESSURE_DATA {
27181 fn default() -> Self {
27182 Self::DEFAULT.clone()
27183 }
27184}
27185impl MessageData for SCALED_PRESSURE_DATA {
27186 type Message = MavMessage;
27187 const ID: u32 = 29u32;
27188 const NAME: &'static str = "SCALED_PRESSURE";
27189 const EXTRA_CRC: u8 = 115u8;
27190 const ENCODED_LEN: usize = 16usize;
27191 fn deser(
27192 _version: MavlinkVersion,
27193 __input: &[u8],
27194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27195 let avail_len = __input.len();
27196 let mut payload_buf = [0; Self::ENCODED_LEN];
27197 let mut buf = if avail_len < Self::ENCODED_LEN {
27198 payload_buf[0..avail_len].copy_from_slice(__input);
27199 Bytes::new(&payload_buf)
27200 } else {
27201 Bytes::new(__input)
27202 };
27203 let mut __struct = Self::default();
27204 __struct.time_boot_ms = buf.get_u32_le();
27205 __struct.press_abs = buf.get_f32_le();
27206 __struct.press_diff = buf.get_f32_le();
27207 __struct.temperature = buf.get_i16_le();
27208 __struct.temperature_press_diff = buf.get_i16_le();
27209 Ok(__struct)
27210 }
27211 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27212 let mut __tmp = BytesMut::new(bytes);
27213 #[allow(clippy::absurd_extreme_comparisons)]
27214 #[allow(unused_comparisons)]
27215 if __tmp.remaining() < Self::ENCODED_LEN {
27216 panic!(
27217 "buffer is too small (need {} bytes, but got {})",
27218 Self::ENCODED_LEN,
27219 __tmp.remaining(),
27220 )
27221 }
27222 __tmp.put_u32_le(self.time_boot_ms);
27223 __tmp.put_f32_le(self.press_abs);
27224 __tmp.put_f32_le(self.press_diff);
27225 __tmp.put_i16_le(self.temperature);
27226 __tmp.put_i16_le(self.temperature_press_diff);
27227 if matches!(version, MavlinkVersion::V2) {
27228 let len = __tmp.len();
27229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27230 } else {
27231 __tmp.len()
27232 }
27233 }
27234}
27235#[doc = "id: 137"]
27236#[doc = "Barometer readings for 2nd barometer."]
27237#[derive(Debug, Clone, PartialEq)]
27238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27240pub struct SCALED_PRESSURE2_DATA {
27241 #[doc = "Timestamp (time since system boot)."]
27242 pub time_boot_ms: u32,
27243 #[doc = "Absolute pressure"]
27244 pub press_abs: f32,
27245 #[doc = "Differential pressure"]
27246 pub press_diff: f32,
27247 #[doc = "Absolute pressure temperature"]
27248 pub temperature: i16,
27249 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27250 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27251 pub temperature_press_diff: i16,
27252}
27253impl SCALED_PRESSURE2_DATA {
27254 pub const ENCODED_LEN: usize = 16usize;
27255 pub const DEFAULT: Self = Self {
27256 time_boot_ms: 0_u32,
27257 press_abs: 0.0_f32,
27258 press_diff: 0.0_f32,
27259 temperature: 0_i16,
27260 temperature_press_diff: 0_i16,
27261 };
27262 #[cfg(feature = "arbitrary")]
27263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27264 use arbitrary::{Arbitrary, Unstructured};
27265 let mut buf = [0u8; 1024];
27266 rng.fill_bytes(&mut buf);
27267 let mut unstructured = Unstructured::new(&buf);
27268 Self::arbitrary(&mut unstructured).unwrap_or_default()
27269 }
27270}
27271impl Default for SCALED_PRESSURE2_DATA {
27272 fn default() -> Self {
27273 Self::DEFAULT.clone()
27274 }
27275}
27276impl MessageData for SCALED_PRESSURE2_DATA {
27277 type Message = MavMessage;
27278 const ID: u32 = 137u32;
27279 const NAME: &'static str = "SCALED_PRESSURE2";
27280 const EXTRA_CRC: u8 = 195u8;
27281 const ENCODED_LEN: usize = 16usize;
27282 fn deser(
27283 _version: MavlinkVersion,
27284 __input: &[u8],
27285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27286 let avail_len = __input.len();
27287 let mut payload_buf = [0; Self::ENCODED_LEN];
27288 let mut buf = if avail_len < Self::ENCODED_LEN {
27289 payload_buf[0..avail_len].copy_from_slice(__input);
27290 Bytes::new(&payload_buf)
27291 } else {
27292 Bytes::new(__input)
27293 };
27294 let mut __struct = Self::default();
27295 __struct.time_boot_ms = buf.get_u32_le();
27296 __struct.press_abs = buf.get_f32_le();
27297 __struct.press_diff = buf.get_f32_le();
27298 __struct.temperature = buf.get_i16_le();
27299 __struct.temperature_press_diff = buf.get_i16_le();
27300 Ok(__struct)
27301 }
27302 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27303 let mut __tmp = BytesMut::new(bytes);
27304 #[allow(clippy::absurd_extreme_comparisons)]
27305 #[allow(unused_comparisons)]
27306 if __tmp.remaining() < Self::ENCODED_LEN {
27307 panic!(
27308 "buffer is too small (need {} bytes, but got {})",
27309 Self::ENCODED_LEN,
27310 __tmp.remaining(),
27311 )
27312 }
27313 __tmp.put_u32_le(self.time_boot_ms);
27314 __tmp.put_f32_le(self.press_abs);
27315 __tmp.put_f32_le(self.press_diff);
27316 __tmp.put_i16_le(self.temperature);
27317 __tmp.put_i16_le(self.temperature_press_diff);
27318 if matches!(version, MavlinkVersion::V2) {
27319 let len = __tmp.len();
27320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27321 } else {
27322 __tmp.len()
27323 }
27324 }
27325}
27326#[doc = "id: 143"]
27327#[doc = "Barometer readings for 3rd barometer."]
27328#[derive(Debug, Clone, PartialEq)]
27329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27331pub struct SCALED_PRESSURE3_DATA {
27332 #[doc = "Timestamp (time since system boot)."]
27333 pub time_boot_ms: u32,
27334 #[doc = "Absolute pressure"]
27335 pub press_abs: f32,
27336 #[doc = "Differential pressure"]
27337 pub press_diff: f32,
27338 #[doc = "Absolute pressure temperature"]
27339 pub temperature: i16,
27340 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27341 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27342 pub temperature_press_diff: i16,
27343}
27344impl SCALED_PRESSURE3_DATA {
27345 pub const ENCODED_LEN: usize = 16usize;
27346 pub const DEFAULT: Self = Self {
27347 time_boot_ms: 0_u32,
27348 press_abs: 0.0_f32,
27349 press_diff: 0.0_f32,
27350 temperature: 0_i16,
27351 temperature_press_diff: 0_i16,
27352 };
27353 #[cfg(feature = "arbitrary")]
27354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27355 use arbitrary::{Arbitrary, Unstructured};
27356 let mut buf = [0u8; 1024];
27357 rng.fill_bytes(&mut buf);
27358 let mut unstructured = Unstructured::new(&buf);
27359 Self::arbitrary(&mut unstructured).unwrap_or_default()
27360 }
27361}
27362impl Default for SCALED_PRESSURE3_DATA {
27363 fn default() -> Self {
27364 Self::DEFAULT.clone()
27365 }
27366}
27367impl MessageData for SCALED_PRESSURE3_DATA {
27368 type Message = MavMessage;
27369 const ID: u32 = 143u32;
27370 const NAME: &'static str = "SCALED_PRESSURE3";
27371 const EXTRA_CRC: u8 = 131u8;
27372 const ENCODED_LEN: usize = 16usize;
27373 fn deser(
27374 _version: MavlinkVersion,
27375 __input: &[u8],
27376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27377 let avail_len = __input.len();
27378 let mut payload_buf = [0; Self::ENCODED_LEN];
27379 let mut buf = if avail_len < Self::ENCODED_LEN {
27380 payload_buf[0..avail_len].copy_from_slice(__input);
27381 Bytes::new(&payload_buf)
27382 } else {
27383 Bytes::new(__input)
27384 };
27385 let mut __struct = Self::default();
27386 __struct.time_boot_ms = buf.get_u32_le();
27387 __struct.press_abs = buf.get_f32_le();
27388 __struct.press_diff = buf.get_f32_le();
27389 __struct.temperature = buf.get_i16_le();
27390 __struct.temperature_press_diff = buf.get_i16_le();
27391 Ok(__struct)
27392 }
27393 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27394 let mut __tmp = BytesMut::new(bytes);
27395 #[allow(clippy::absurd_extreme_comparisons)]
27396 #[allow(unused_comparisons)]
27397 if __tmp.remaining() < Self::ENCODED_LEN {
27398 panic!(
27399 "buffer is too small (need {} bytes, but got {})",
27400 Self::ENCODED_LEN,
27401 __tmp.remaining(),
27402 )
27403 }
27404 __tmp.put_u32_le(self.time_boot_ms);
27405 __tmp.put_f32_le(self.press_abs);
27406 __tmp.put_f32_le(self.press_diff);
27407 __tmp.put_i16_le(self.temperature);
27408 __tmp.put_i16_le(self.temperature_press_diff);
27409 if matches!(version, MavlinkVersion::V2) {
27410 let len = __tmp.len();
27411 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27412 } else {
27413 __tmp.len()
27414 }
27415 }
27416}
27417#[doc = "id: 8012"]
27418#[doc = "Monitoring of sensorpod status."]
27419#[derive(Debug, Clone, PartialEq)]
27420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27422pub struct SENSORPOD_STATUS_DATA {
27423 #[doc = "Timestamp in linuxtime (since 1.1.1970)"]
27424 pub timestamp: u64,
27425 #[doc = "Free space available in recordings directory in [Gb] * 1e2"]
27426 pub free_space: u16,
27427 #[doc = "Rate of ROS topic 1"]
27428 pub visensor_rate_1: u8,
27429 #[doc = "Rate of ROS topic 2"]
27430 pub visensor_rate_2: u8,
27431 #[doc = "Rate of ROS topic 3"]
27432 pub visensor_rate_3: u8,
27433 #[doc = "Rate of ROS topic 4"]
27434 pub visensor_rate_4: u8,
27435 #[doc = "Number of recording nodes"]
27436 pub recording_nodes_count: u8,
27437 #[doc = "Temperature of sensorpod CPU in"]
27438 pub cpu_temp: u8,
27439}
27440impl SENSORPOD_STATUS_DATA {
27441 pub const ENCODED_LEN: usize = 16usize;
27442 pub const DEFAULT: Self = Self {
27443 timestamp: 0_u64,
27444 free_space: 0_u16,
27445 visensor_rate_1: 0_u8,
27446 visensor_rate_2: 0_u8,
27447 visensor_rate_3: 0_u8,
27448 visensor_rate_4: 0_u8,
27449 recording_nodes_count: 0_u8,
27450 cpu_temp: 0_u8,
27451 };
27452 #[cfg(feature = "arbitrary")]
27453 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27454 use arbitrary::{Arbitrary, Unstructured};
27455 let mut buf = [0u8; 1024];
27456 rng.fill_bytes(&mut buf);
27457 let mut unstructured = Unstructured::new(&buf);
27458 Self::arbitrary(&mut unstructured).unwrap_or_default()
27459 }
27460}
27461impl Default for SENSORPOD_STATUS_DATA {
27462 fn default() -> Self {
27463 Self::DEFAULT.clone()
27464 }
27465}
27466impl MessageData for SENSORPOD_STATUS_DATA {
27467 type Message = MavMessage;
27468 const ID: u32 = 8012u32;
27469 const NAME: &'static str = "SENSORPOD_STATUS";
27470 const EXTRA_CRC: u8 = 54u8;
27471 const ENCODED_LEN: usize = 16usize;
27472 fn deser(
27473 _version: MavlinkVersion,
27474 __input: &[u8],
27475 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27476 let avail_len = __input.len();
27477 let mut payload_buf = [0; Self::ENCODED_LEN];
27478 let mut buf = if avail_len < Self::ENCODED_LEN {
27479 payload_buf[0..avail_len].copy_from_slice(__input);
27480 Bytes::new(&payload_buf)
27481 } else {
27482 Bytes::new(__input)
27483 };
27484 let mut __struct = Self::default();
27485 __struct.timestamp = buf.get_u64_le();
27486 __struct.free_space = buf.get_u16_le();
27487 __struct.visensor_rate_1 = buf.get_u8();
27488 __struct.visensor_rate_2 = buf.get_u8();
27489 __struct.visensor_rate_3 = buf.get_u8();
27490 __struct.visensor_rate_4 = buf.get_u8();
27491 __struct.recording_nodes_count = buf.get_u8();
27492 __struct.cpu_temp = buf.get_u8();
27493 Ok(__struct)
27494 }
27495 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27496 let mut __tmp = BytesMut::new(bytes);
27497 #[allow(clippy::absurd_extreme_comparisons)]
27498 #[allow(unused_comparisons)]
27499 if __tmp.remaining() < Self::ENCODED_LEN {
27500 panic!(
27501 "buffer is too small (need {} bytes, but got {})",
27502 Self::ENCODED_LEN,
27503 __tmp.remaining(),
27504 )
27505 }
27506 __tmp.put_u64_le(self.timestamp);
27507 __tmp.put_u16_le(self.free_space);
27508 __tmp.put_u8(self.visensor_rate_1);
27509 __tmp.put_u8(self.visensor_rate_2);
27510 __tmp.put_u8(self.visensor_rate_3);
27511 __tmp.put_u8(self.visensor_rate_4);
27512 __tmp.put_u8(self.recording_nodes_count);
27513 __tmp.put_u8(self.cpu_temp);
27514 if matches!(version, MavlinkVersion::V2) {
27515 let len = __tmp.len();
27516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27517 } else {
27518 __tmp.len()
27519 }
27520 }
27521}
27522#[doc = "id: 8016"]
27523#[doc = "Calibrated airflow angle measurements."]
27524#[derive(Debug, Clone, PartialEq)]
27525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27527pub struct SENSOR_AIRFLOW_ANGLES_DATA {
27528 #[doc = "Timestamp"]
27529 pub timestamp: u64,
27530 #[doc = "Angle of attack"]
27531 pub angleofattack: f32,
27532 #[doc = "Sideslip angle"]
27533 pub sideslip: f32,
27534 #[doc = "Angle of attack measurement valid"]
27535 pub angleofattack_valid: u8,
27536 #[doc = "Sideslip angle measurement valid"]
27537 pub sideslip_valid: u8,
27538}
27539impl SENSOR_AIRFLOW_ANGLES_DATA {
27540 pub const ENCODED_LEN: usize = 18usize;
27541 pub const DEFAULT: Self = Self {
27542 timestamp: 0_u64,
27543 angleofattack: 0.0_f32,
27544 sideslip: 0.0_f32,
27545 angleofattack_valid: 0_u8,
27546 sideslip_valid: 0_u8,
27547 };
27548 #[cfg(feature = "arbitrary")]
27549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27550 use arbitrary::{Arbitrary, Unstructured};
27551 let mut buf = [0u8; 1024];
27552 rng.fill_bytes(&mut buf);
27553 let mut unstructured = Unstructured::new(&buf);
27554 Self::arbitrary(&mut unstructured).unwrap_or_default()
27555 }
27556}
27557impl Default for SENSOR_AIRFLOW_ANGLES_DATA {
27558 fn default() -> Self {
27559 Self::DEFAULT.clone()
27560 }
27561}
27562impl MessageData for SENSOR_AIRFLOW_ANGLES_DATA {
27563 type Message = MavMessage;
27564 const ID: u32 = 8016u32;
27565 const NAME: &'static str = "SENSOR_AIRFLOW_ANGLES";
27566 const EXTRA_CRC: u8 = 149u8;
27567 const ENCODED_LEN: usize = 18usize;
27568 fn deser(
27569 _version: MavlinkVersion,
27570 __input: &[u8],
27571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27572 let avail_len = __input.len();
27573 let mut payload_buf = [0; Self::ENCODED_LEN];
27574 let mut buf = if avail_len < Self::ENCODED_LEN {
27575 payload_buf[0..avail_len].copy_from_slice(__input);
27576 Bytes::new(&payload_buf)
27577 } else {
27578 Bytes::new(__input)
27579 };
27580 let mut __struct = Self::default();
27581 __struct.timestamp = buf.get_u64_le();
27582 __struct.angleofattack = buf.get_f32_le();
27583 __struct.sideslip = buf.get_f32_le();
27584 __struct.angleofattack_valid = buf.get_u8();
27585 __struct.sideslip_valid = buf.get_u8();
27586 Ok(__struct)
27587 }
27588 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27589 let mut __tmp = BytesMut::new(bytes);
27590 #[allow(clippy::absurd_extreme_comparisons)]
27591 #[allow(unused_comparisons)]
27592 if __tmp.remaining() < Self::ENCODED_LEN {
27593 panic!(
27594 "buffer is too small (need {} bytes, but got {})",
27595 Self::ENCODED_LEN,
27596 __tmp.remaining(),
27597 )
27598 }
27599 __tmp.put_u64_le(self.timestamp);
27600 __tmp.put_f32_le(self.angleofattack);
27601 __tmp.put_f32_le(self.sideslip);
27602 __tmp.put_u8(self.angleofattack_valid);
27603 __tmp.put_u8(self.sideslip_valid);
27604 if matches!(version, MavlinkVersion::V2) {
27605 let len = __tmp.len();
27606 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27607 } else {
27608 __tmp.len()
27609 }
27610 }
27611}
27612#[doc = "id: 8009"]
27613#[doc = "Atmospheric sensors (temperature, humidity, ...)."]
27614#[derive(Debug, Clone, PartialEq)]
27615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27617pub struct SENS_ATMOS_DATA {
27618 #[doc = "Time since system boot"]
27619 pub timestamp: u64,
27620 #[doc = "Ambient temperature"]
27621 pub TempAmbient: f32,
27622 #[doc = "Relative humidity"]
27623 pub Humidity: f32,
27624}
27625impl SENS_ATMOS_DATA {
27626 pub const ENCODED_LEN: usize = 16usize;
27627 pub const DEFAULT: Self = Self {
27628 timestamp: 0_u64,
27629 TempAmbient: 0.0_f32,
27630 Humidity: 0.0_f32,
27631 };
27632 #[cfg(feature = "arbitrary")]
27633 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27634 use arbitrary::{Arbitrary, Unstructured};
27635 let mut buf = [0u8; 1024];
27636 rng.fill_bytes(&mut buf);
27637 let mut unstructured = Unstructured::new(&buf);
27638 Self::arbitrary(&mut unstructured).unwrap_or_default()
27639 }
27640}
27641impl Default for SENS_ATMOS_DATA {
27642 fn default() -> Self {
27643 Self::DEFAULT.clone()
27644 }
27645}
27646impl MessageData for SENS_ATMOS_DATA {
27647 type Message = MavMessage;
27648 const ID: u32 = 8009u32;
27649 const NAME: &'static str = "SENS_ATMOS";
27650 const EXTRA_CRC: u8 = 144u8;
27651 const ENCODED_LEN: usize = 16usize;
27652 fn deser(
27653 _version: MavlinkVersion,
27654 __input: &[u8],
27655 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27656 let avail_len = __input.len();
27657 let mut payload_buf = [0; Self::ENCODED_LEN];
27658 let mut buf = if avail_len < Self::ENCODED_LEN {
27659 payload_buf[0..avail_len].copy_from_slice(__input);
27660 Bytes::new(&payload_buf)
27661 } else {
27662 Bytes::new(__input)
27663 };
27664 let mut __struct = Self::default();
27665 __struct.timestamp = buf.get_u64_le();
27666 __struct.TempAmbient = buf.get_f32_le();
27667 __struct.Humidity = buf.get_f32_le();
27668 Ok(__struct)
27669 }
27670 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27671 let mut __tmp = BytesMut::new(bytes);
27672 #[allow(clippy::absurd_extreme_comparisons)]
27673 #[allow(unused_comparisons)]
27674 if __tmp.remaining() < Self::ENCODED_LEN {
27675 panic!(
27676 "buffer is too small (need {} bytes, but got {})",
27677 Self::ENCODED_LEN,
27678 __tmp.remaining(),
27679 )
27680 }
27681 __tmp.put_u64_le(self.timestamp);
27682 __tmp.put_f32_le(self.TempAmbient);
27683 __tmp.put_f32_le(self.Humidity);
27684 if matches!(version, MavlinkVersion::V2) {
27685 let len = __tmp.len();
27686 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27687 } else {
27688 __tmp.len()
27689 }
27690 }
27691}
27692#[doc = "id: 8010"]
27693#[doc = "Battery pack monitoring data for Li-Ion batteries."]
27694#[derive(Debug, Clone, PartialEq)]
27695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27697pub struct SENS_BATMON_DATA {
27698 #[doc = "Time since system start"]
27699 pub batmon_timestamp: u64,
27700 #[doc = "Battery pack temperature"]
27701 pub temperature: f32,
27702 #[doc = "Battery monitor safetystatus report bits in Hex"]
27703 pub safetystatus: u32,
27704 #[doc = "Battery monitor operation status report bits in Hex"]
27705 pub operationstatus: u32,
27706 #[doc = "Battery pack voltage"]
27707 pub voltage: u16,
27708 #[doc = "Battery pack current"]
27709 pub current: i16,
27710 #[doc = "Battery monitor status report bits in Hex"]
27711 pub batterystatus: u16,
27712 #[doc = "Battery monitor serial number in Hex"]
27713 pub serialnumber: u16,
27714 #[doc = "Battery pack cell 1 voltage"]
27715 pub cellvoltage1: u16,
27716 #[doc = "Battery pack cell 2 voltage"]
27717 pub cellvoltage2: u16,
27718 #[doc = "Battery pack cell 3 voltage"]
27719 pub cellvoltage3: u16,
27720 #[doc = "Battery pack cell 4 voltage"]
27721 pub cellvoltage4: u16,
27722 #[doc = "Battery pack cell 5 voltage"]
27723 pub cellvoltage5: u16,
27724 #[doc = "Battery pack cell 6 voltage"]
27725 pub cellvoltage6: u16,
27726 #[doc = "Battery pack state-of-charge"]
27727 pub SoC: u8,
27728}
27729impl SENS_BATMON_DATA {
27730 pub const ENCODED_LEN: usize = 41usize;
27731 pub const DEFAULT: Self = Self {
27732 batmon_timestamp: 0_u64,
27733 temperature: 0.0_f32,
27734 safetystatus: 0_u32,
27735 operationstatus: 0_u32,
27736 voltage: 0_u16,
27737 current: 0_i16,
27738 batterystatus: 0_u16,
27739 serialnumber: 0_u16,
27740 cellvoltage1: 0_u16,
27741 cellvoltage2: 0_u16,
27742 cellvoltage3: 0_u16,
27743 cellvoltage4: 0_u16,
27744 cellvoltage5: 0_u16,
27745 cellvoltage6: 0_u16,
27746 SoC: 0_u8,
27747 };
27748 #[cfg(feature = "arbitrary")]
27749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27750 use arbitrary::{Arbitrary, Unstructured};
27751 let mut buf = [0u8; 1024];
27752 rng.fill_bytes(&mut buf);
27753 let mut unstructured = Unstructured::new(&buf);
27754 Self::arbitrary(&mut unstructured).unwrap_or_default()
27755 }
27756}
27757impl Default for SENS_BATMON_DATA {
27758 fn default() -> Self {
27759 Self::DEFAULT.clone()
27760 }
27761}
27762impl MessageData for SENS_BATMON_DATA {
27763 type Message = MavMessage;
27764 const ID: u32 = 8010u32;
27765 const NAME: &'static str = "SENS_BATMON";
27766 const EXTRA_CRC: u8 = 155u8;
27767 const ENCODED_LEN: usize = 41usize;
27768 fn deser(
27769 _version: MavlinkVersion,
27770 __input: &[u8],
27771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27772 let avail_len = __input.len();
27773 let mut payload_buf = [0; Self::ENCODED_LEN];
27774 let mut buf = if avail_len < Self::ENCODED_LEN {
27775 payload_buf[0..avail_len].copy_from_slice(__input);
27776 Bytes::new(&payload_buf)
27777 } else {
27778 Bytes::new(__input)
27779 };
27780 let mut __struct = Self::default();
27781 __struct.batmon_timestamp = buf.get_u64_le();
27782 __struct.temperature = buf.get_f32_le();
27783 __struct.safetystatus = buf.get_u32_le();
27784 __struct.operationstatus = buf.get_u32_le();
27785 __struct.voltage = buf.get_u16_le();
27786 __struct.current = buf.get_i16_le();
27787 __struct.batterystatus = buf.get_u16_le();
27788 __struct.serialnumber = buf.get_u16_le();
27789 __struct.cellvoltage1 = buf.get_u16_le();
27790 __struct.cellvoltage2 = buf.get_u16_le();
27791 __struct.cellvoltage3 = buf.get_u16_le();
27792 __struct.cellvoltage4 = buf.get_u16_le();
27793 __struct.cellvoltage5 = buf.get_u16_le();
27794 __struct.cellvoltage6 = buf.get_u16_le();
27795 __struct.SoC = buf.get_u8();
27796 Ok(__struct)
27797 }
27798 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27799 let mut __tmp = BytesMut::new(bytes);
27800 #[allow(clippy::absurd_extreme_comparisons)]
27801 #[allow(unused_comparisons)]
27802 if __tmp.remaining() < Self::ENCODED_LEN {
27803 panic!(
27804 "buffer is too small (need {} bytes, but got {})",
27805 Self::ENCODED_LEN,
27806 __tmp.remaining(),
27807 )
27808 }
27809 __tmp.put_u64_le(self.batmon_timestamp);
27810 __tmp.put_f32_le(self.temperature);
27811 __tmp.put_u32_le(self.safetystatus);
27812 __tmp.put_u32_le(self.operationstatus);
27813 __tmp.put_u16_le(self.voltage);
27814 __tmp.put_i16_le(self.current);
27815 __tmp.put_u16_le(self.batterystatus);
27816 __tmp.put_u16_le(self.serialnumber);
27817 __tmp.put_u16_le(self.cellvoltage1);
27818 __tmp.put_u16_le(self.cellvoltage2);
27819 __tmp.put_u16_le(self.cellvoltage3);
27820 __tmp.put_u16_le(self.cellvoltage4);
27821 __tmp.put_u16_le(self.cellvoltage5);
27822 __tmp.put_u16_le(self.cellvoltage6);
27823 __tmp.put_u8(self.SoC);
27824 if matches!(version, MavlinkVersion::V2) {
27825 let len = __tmp.len();
27826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27827 } else {
27828 __tmp.len()
27829 }
27830 }
27831}
27832#[doc = "id: 8003"]
27833#[doc = "Maximum Power Point Tracker (MPPT) sensor data for solar module power performance tracking."]
27834#[derive(Debug, Clone, PartialEq)]
27835#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27837pub struct SENS_MPPT_DATA {
27838 #[doc = "MPPT last timestamp"]
27839 pub mppt_timestamp: u64,
27840 #[doc = "MPPT1 voltage"]
27841 pub mppt1_volt: f32,
27842 #[doc = "MPPT1 current"]
27843 pub mppt1_amp: f32,
27844 #[doc = "MPPT2 voltage"]
27845 pub mppt2_volt: f32,
27846 #[doc = "MPPT2 current"]
27847 pub mppt2_amp: f32,
27848 #[doc = "MPPT3 voltage"]
27849 pub mppt3_volt: f32,
27850 #[doc = "MPPT3 current"]
27851 pub mppt3_amp: f32,
27852 #[doc = "MPPT1 pwm"]
27853 pub mppt1_pwm: u16,
27854 #[doc = "MPPT2 pwm"]
27855 pub mppt2_pwm: u16,
27856 #[doc = "MPPT3 pwm"]
27857 pub mppt3_pwm: u16,
27858 #[doc = "MPPT1 status"]
27859 pub mppt1_status: u8,
27860 #[doc = "MPPT2 status"]
27861 pub mppt2_status: u8,
27862 #[doc = "MPPT3 status"]
27863 pub mppt3_status: u8,
27864}
27865impl SENS_MPPT_DATA {
27866 pub const ENCODED_LEN: usize = 41usize;
27867 pub const DEFAULT: Self = Self {
27868 mppt_timestamp: 0_u64,
27869 mppt1_volt: 0.0_f32,
27870 mppt1_amp: 0.0_f32,
27871 mppt2_volt: 0.0_f32,
27872 mppt2_amp: 0.0_f32,
27873 mppt3_volt: 0.0_f32,
27874 mppt3_amp: 0.0_f32,
27875 mppt1_pwm: 0_u16,
27876 mppt2_pwm: 0_u16,
27877 mppt3_pwm: 0_u16,
27878 mppt1_status: 0_u8,
27879 mppt2_status: 0_u8,
27880 mppt3_status: 0_u8,
27881 };
27882 #[cfg(feature = "arbitrary")]
27883 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27884 use arbitrary::{Arbitrary, Unstructured};
27885 let mut buf = [0u8; 1024];
27886 rng.fill_bytes(&mut buf);
27887 let mut unstructured = Unstructured::new(&buf);
27888 Self::arbitrary(&mut unstructured).unwrap_or_default()
27889 }
27890}
27891impl Default for SENS_MPPT_DATA {
27892 fn default() -> Self {
27893 Self::DEFAULT.clone()
27894 }
27895}
27896impl MessageData for SENS_MPPT_DATA {
27897 type Message = MavMessage;
27898 const ID: u32 = 8003u32;
27899 const NAME: &'static str = "SENS_MPPT";
27900 const EXTRA_CRC: u8 = 231u8;
27901 const ENCODED_LEN: usize = 41usize;
27902 fn deser(
27903 _version: MavlinkVersion,
27904 __input: &[u8],
27905 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27906 let avail_len = __input.len();
27907 let mut payload_buf = [0; Self::ENCODED_LEN];
27908 let mut buf = if avail_len < Self::ENCODED_LEN {
27909 payload_buf[0..avail_len].copy_from_slice(__input);
27910 Bytes::new(&payload_buf)
27911 } else {
27912 Bytes::new(__input)
27913 };
27914 let mut __struct = Self::default();
27915 __struct.mppt_timestamp = buf.get_u64_le();
27916 __struct.mppt1_volt = buf.get_f32_le();
27917 __struct.mppt1_amp = buf.get_f32_le();
27918 __struct.mppt2_volt = buf.get_f32_le();
27919 __struct.mppt2_amp = buf.get_f32_le();
27920 __struct.mppt3_volt = buf.get_f32_le();
27921 __struct.mppt3_amp = buf.get_f32_le();
27922 __struct.mppt1_pwm = buf.get_u16_le();
27923 __struct.mppt2_pwm = buf.get_u16_le();
27924 __struct.mppt3_pwm = buf.get_u16_le();
27925 __struct.mppt1_status = buf.get_u8();
27926 __struct.mppt2_status = buf.get_u8();
27927 __struct.mppt3_status = buf.get_u8();
27928 Ok(__struct)
27929 }
27930 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27931 let mut __tmp = BytesMut::new(bytes);
27932 #[allow(clippy::absurd_extreme_comparisons)]
27933 #[allow(unused_comparisons)]
27934 if __tmp.remaining() < Self::ENCODED_LEN {
27935 panic!(
27936 "buffer is too small (need {} bytes, but got {})",
27937 Self::ENCODED_LEN,
27938 __tmp.remaining(),
27939 )
27940 }
27941 __tmp.put_u64_le(self.mppt_timestamp);
27942 __tmp.put_f32_le(self.mppt1_volt);
27943 __tmp.put_f32_le(self.mppt1_amp);
27944 __tmp.put_f32_le(self.mppt2_volt);
27945 __tmp.put_f32_le(self.mppt2_amp);
27946 __tmp.put_f32_le(self.mppt3_volt);
27947 __tmp.put_f32_le(self.mppt3_amp);
27948 __tmp.put_u16_le(self.mppt1_pwm);
27949 __tmp.put_u16_le(self.mppt2_pwm);
27950 __tmp.put_u16_le(self.mppt3_pwm);
27951 __tmp.put_u8(self.mppt1_status);
27952 __tmp.put_u8(self.mppt2_status);
27953 __tmp.put_u8(self.mppt3_status);
27954 if matches!(version, MavlinkVersion::V2) {
27955 let len = __tmp.len();
27956 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27957 } else {
27958 __tmp.len()
27959 }
27960 }
27961}
27962#[doc = "id: 8002"]
27963#[doc = "Voltage and current sensor data."]
27964#[derive(Debug, Clone, PartialEq)]
27965#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27966#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27967pub struct SENS_POWER_DATA {
27968 #[doc = "Power board voltage sensor reading"]
27969 pub adc121_vspb_volt: f32,
27970 #[doc = "Power board current sensor reading"]
27971 pub adc121_cspb_amp: f32,
27972 #[doc = "Board current sensor 1 reading"]
27973 pub adc121_cs1_amp: f32,
27974 #[doc = "Board current sensor 2 reading"]
27975 pub adc121_cs2_amp: f32,
27976}
27977impl SENS_POWER_DATA {
27978 pub const ENCODED_LEN: usize = 16usize;
27979 pub const DEFAULT: Self = Self {
27980 adc121_vspb_volt: 0.0_f32,
27981 adc121_cspb_amp: 0.0_f32,
27982 adc121_cs1_amp: 0.0_f32,
27983 adc121_cs2_amp: 0.0_f32,
27984 };
27985 #[cfg(feature = "arbitrary")]
27986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27987 use arbitrary::{Arbitrary, Unstructured};
27988 let mut buf = [0u8; 1024];
27989 rng.fill_bytes(&mut buf);
27990 let mut unstructured = Unstructured::new(&buf);
27991 Self::arbitrary(&mut unstructured).unwrap_or_default()
27992 }
27993}
27994impl Default for SENS_POWER_DATA {
27995 fn default() -> Self {
27996 Self::DEFAULT.clone()
27997 }
27998}
27999impl MessageData for SENS_POWER_DATA {
28000 type Message = MavMessage;
28001 const ID: u32 = 8002u32;
28002 const NAME: &'static str = "SENS_POWER";
28003 const EXTRA_CRC: u8 = 218u8;
28004 const ENCODED_LEN: usize = 16usize;
28005 fn deser(
28006 _version: MavlinkVersion,
28007 __input: &[u8],
28008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28009 let avail_len = __input.len();
28010 let mut payload_buf = [0; Self::ENCODED_LEN];
28011 let mut buf = if avail_len < Self::ENCODED_LEN {
28012 payload_buf[0..avail_len].copy_from_slice(__input);
28013 Bytes::new(&payload_buf)
28014 } else {
28015 Bytes::new(__input)
28016 };
28017 let mut __struct = Self::default();
28018 __struct.adc121_vspb_volt = buf.get_f32_le();
28019 __struct.adc121_cspb_amp = buf.get_f32_le();
28020 __struct.adc121_cs1_amp = buf.get_f32_le();
28021 __struct.adc121_cs2_amp = buf.get_f32_le();
28022 Ok(__struct)
28023 }
28024 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28025 let mut __tmp = BytesMut::new(bytes);
28026 #[allow(clippy::absurd_extreme_comparisons)]
28027 #[allow(unused_comparisons)]
28028 if __tmp.remaining() < Self::ENCODED_LEN {
28029 panic!(
28030 "buffer is too small (need {} bytes, but got {})",
28031 Self::ENCODED_LEN,
28032 __tmp.remaining(),
28033 )
28034 }
28035 __tmp.put_f32_le(self.adc121_vspb_volt);
28036 __tmp.put_f32_le(self.adc121_cspb_amp);
28037 __tmp.put_f32_le(self.adc121_cs1_amp);
28038 __tmp.put_f32_le(self.adc121_cs2_amp);
28039 if matches!(version, MavlinkVersion::V2) {
28040 let len = __tmp.len();
28041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28042 } else {
28043 __tmp.len()
28044 }
28045 }
28046}
28047#[doc = "id: 8013"]
28048#[doc = "Monitoring of power board status."]
28049#[derive(Debug, Clone, PartialEq)]
28050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28052pub struct SENS_POWER_BOARD_DATA {
28053 #[doc = "Timestamp"]
28054 pub timestamp: u64,
28055 #[doc = "Power board system voltage"]
28056 pub pwr_brd_system_volt: f32,
28057 #[doc = "Power board servo voltage"]
28058 pub pwr_brd_servo_volt: f32,
28059 #[doc = "Power board digital voltage"]
28060 pub pwr_brd_digital_volt: f32,
28061 #[doc = "Power board left motor current sensor"]
28062 pub pwr_brd_mot_l_amp: f32,
28063 #[doc = "Power board right motor current sensor"]
28064 pub pwr_brd_mot_r_amp: f32,
28065 #[doc = "Power board analog current sensor"]
28066 pub pwr_brd_analog_amp: f32,
28067 #[doc = "Power board digital current sensor"]
28068 pub pwr_brd_digital_amp: f32,
28069 #[doc = "Power board extension current sensor"]
28070 pub pwr_brd_ext_amp: f32,
28071 #[doc = "Power board aux current sensor"]
28072 pub pwr_brd_aux_amp: f32,
28073 #[doc = "Power board status register"]
28074 pub pwr_brd_status: u8,
28075 #[doc = "Power board leds status"]
28076 pub pwr_brd_led_status: u8,
28077}
28078impl SENS_POWER_BOARD_DATA {
28079 pub const ENCODED_LEN: usize = 46usize;
28080 pub const DEFAULT: Self = Self {
28081 timestamp: 0_u64,
28082 pwr_brd_system_volt: 0.0_f32,
28083 pwr_brd_servo_volt: 0.0_f32,
28084 pwr_brd_digital_volt: 0.0_f32,
28085 pwr_brd_mot_l_amp: 0.0_f32,
28086 pwr_brd_mot_r_amp: 0.0_f32,
28087 pwr_brd_analog_amp: 0.0_f32,
28088 pwr_brd_digital_amp: 0.0_f32,
28089 pwr_brd_ext_amp: 0.0_f32,
28090 pwr_brd_aux_amp: 0.0_f32,
28091 pwr_brd_status: 0_u8,
28092 pwr_brd_led_status: 0_u8,
28093 };
28094 #[cfg(feature = "arbitrary")]
28095 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28096 use arbitrary::{Arbitrary, Unstructured};
28097 let mut buf = [0u8; 1024];
28098 rng.fill_bytes(&mut buf);
28099 let mut unstructured = Unstructured::new(&buf);
28100 Self::arbitrary(&mut unstructured).unwrap_or_default()
28101 }
28102}
28103impl Default for SENS_POWER_BOARD_DATA {
28104 fn default() -> Self {
28105 Self::DEFAULT.clone()
28106 }
28107}
28108impl MessageData for SENS_POWER_BOARD_DATA {
28109 type Message = MavMessage;
28110 const ID: u32 = 8013u32;
28111 const NAME: &'static str = "SENS_POWER_BOARD";
28112 const EXTRA_CRC: u8 = 222u8;
28113 const ENCODED_LEN: usize = 46usize;
28114 fn deser(
28115 _version: MavlinkVersion,
28116 __input: &[u8],
28117 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28118 let avail_len = __input.len();
28119 let mut payload_buf = [0; Self::ENCODED_LEN];
28120 let mut buf = if avail_len < Self::ENCODED_LEN {
28121 payload_buf[0..avail_len].copy_from_slice(__input);
28122 Bytes::new(&payload_buf)
28123 } else {
28124 Bytes::new(__input)
28125 };
28126 let mut __struct = Self::default();
28127 __struct.timestamp = buf.get_u64_le();
28128 __struct.pwr_brd_system_volt = buf.get_f32_le();
28129 __struct.pwr_brd_servo_volt = buf.get_f32_le();
28130 __struct.pwr_brd_digital_volt = buf.get_f32_le();
28131 __struct.pwr_brd_mot_l_amp = buf.get_f32_le();
28132 __struct.pwr_brd_mot_r_amp = buf.get_f32_le();
28133 __struct.pwr_brd_analog_amp = buf.get_f32_le();
28134 __struct.pwr_brd_digital_amp = buf.get_f32_le();
28135 __struct.pwr_brd_ext_amp = buf.get_f32_le();
28136 __struct.pwr_brd_aux_amp = buf.get_f32_le();
28137 __struct.pwr_brd_status = buf.get_u8();
28138 __struct.pwr_brd_led_status = buf.get_u8();
28139 Ok(__struct)
28140 }
28141 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28142 let mut __tmp = BytesMut::new(bytes);
28143 #[allow(clippy::absurd_extreme_comparisons)]
28144 #[allow(unused_comparisons)]
28145 if __tmp.remaining() < Self::ENCODED_LEN {
28146 panic!(
28147 "buffer is too small (need {} bytes, but got {})",
28148 Self::ENCODED_LEN,
28149 __tmp.remaining(),
28150 )
28151 }
28152 __tmp.put_u64_le(self.timestamp);
28153 __tmp.put_f32_le(self.pwr_brd_system_volt);
28154 __tmp.put_f32_le(self.pwr_brd_servo_volt);
28155 __tmp.put_f32_le(self.pwr_brd_digital_volt);
28156 __tmp.put_f32_le(self.pwr_brd_mot_l_amp);
28157 __tmp.put_f32_le(self.pwr_brd_mot_r_amp);
28158 __tmp.put_f32_le(self.pwr_brd_analog_amp);
28159 __tmp.put_f32_le(self.pwr_brd_digital_amp);
28160 __tmp.put_f32_le(self.pwr_brd_ext_amp);
28161 __tmp.put_f32_le(self.pwr_brd_aux_amp);
28162 __tmp.put_u8(self.pwr_brd_status);
28163 __tmp.put_u8(self.pwr_brd_led_status);
28164 if matches!(version, MavlinkVersion::V2) {
28165 let len = __tmp.len();
28166 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28167 } else {
28168 __tmp.len()
28169 }
28170 }
28171}
28172#[doc = "id: 126"]
28173#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
28174#[derive(Debug, Clone, PartialEq)]
28175#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28177pub struct SERIAL_CONTROL_DATA {
28178 #[doc = "Baudrate of transfer. Zero means no change."]
28179 pub baudrate: u32,
28180 #[doc = "Timeout for reply data"]
28181 pub timeout: u16,
28182 #[doc = "Serial control device type."]
28183 pub device: SerialControlDev,
28184 #[doc = "Bitmap of serial control flags."]
28185 pub flags: SerialControlFlag,
28186 #[doc = "how many bytes in this transfer"]
28187 pub count: u8,
28188 #[doc = "serial data"]
28189 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28190 pub data: [u8; 70],
28191 #[doc = "System ID"]
28192 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28193 pub target_system: u8,
28194 #[doc = "Component ID"]
28195 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28196 pub target_component: u8,
28197}
28198impl SERIAL_CONTROL_DATA {
28199 pub const ENCODED_LEN: usize = 81usize;
28200 pub const DEFAULT: Self = Self {
28201 baudrate: 0_u32,
28202 timeout: 0_u16,
28203 device: SerialControlDev::DEFAULT,
28204 flags: SerialControlFlag::DEFAULT,
28205 count: 0_u8,
28206 data: [0_u8; 70usize],
28207 target_system: 0_u8,
28208 target_component: 0_u8,
28209 };
28210 #[cfg(feature = "arbitrary")]
28211 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28212 use arbitrary::{Arbitrary, Unstructured};
28213 let mut buf = [0u8; 1024];
28214 rng.fill_bytes(&mut buf);
28215 let mut unstructured = Unstructured::new(&buf);
28216 Self::arbitrary(&mut unstructured).unwrap_or_default()
28217 }
28218}
28219impl Default for SERIAL_CONTROL_DATA {
28220 fn default() -> Self {
28221 Self::DEFAULT.clone()
28222 }
28223}
28224impl MessageData for SERIAL_CONTROL_DATA {
28225 type Message = MavMessage;
28226 const ID: u32 = 126u32;
28227 const NAME: &'static str = "SERIAL_CONTROL";
28228 const EXTRA_CRC: u8 = 220u8;
28229 const ENCODED_LEN: usize = 81usize;
28230 fn deser(
28231 _version: MavlinkVersion,
28232 __input: &[u8],
28233 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28234 let avail_len = __input.len();
28235 let mut payload_buf = [0; Self::ENCODED_LEN];
28236 let mut buf = if avail_len < Self::ENCODED_LEN {
28237 payload_buf[0..avail_len].copy_from_slice(__input);
28238 Bytes::new(&payload_buf)
28239 } else {
28240 Bytes::new(__input)
28241 };
28242 let mut __struct = Self::default();
28243 __struct.baudrate = buf.get_u32_le();
28244 __struct.timeout = buf.get_u16_le();
28245 let tmp = buf.get_u8();
28246 __struct.device =
28247 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28248 enum_type: "SerialControlDev",
28249 value: tmp as u32,
28250 })?;
28251 let tmp = buf.get_u8();
28252 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
28253 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28254 flag_type: "SerialControlFlag",
28255 value: tmp as u32,
28256 })?;
28257 __struct.count = buf.get_u8();
28258 for v in &mut __struct.data {
28259 let val = buf.get_u8();
28260 *v = val;
28261 }
28262 __struct.target_system = buf.get_u8();
28263 __struct.target_component = buf.get_u8();
28264 Ok(__struct)
28265 }
28266 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28267 let mut __tmp = BytesMut::new(bytes);
28268 #[allow(clippy::absurd_extreme_comparisons)]
28269 #[allow(unused_comparisons)]
28270 if __tmp.remaining() < Self::ENCODED_LEN {
28271 panic!(
28272 "buffer is too small (need {} bytes, but got {})",
28273 Self::ENCODED_LEN,
28274 __tmp.remaining(),
28275 )
28276 }
28277 __tmp.put_u32_le(self.baudrate);
28278 __tmp.put_u16_le(self.timeout);
28279 __tmp.put_u8(self.device as u8);
28280 __tmp.put_u8(self.flags.bits());
28281 __tmp.put_u8(self.count);
28282 for val in &self.data {
28283 __tmp.put_u8(*val);
28284 }
28285 __tmp.put_u8(self.target_system);
28286 __tmp.put_u8(self.target_component);
28287 if matches!(version, MavlinkVersion::V2) {
28288 let len = __tmp.len();
28289 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28290 } else {
28291 __tmp.len()
28292 }
28293 }
28294}
28295#[doc = "id: 36"]
28296#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
28297#[derive(Debug, Clone, PartialEq)]
28298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28299#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28300pub struct SERVO_OUTPUT_RAW_DATA {
28301 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28302 pub time_usec: u32,
28303 #[doc = "Servo output 1 value"]
28304 pub servo1_raw: u16,
28305 #[doc = "Servo output 2 value"]
28306 pub servo2_raw: u16,
28307 #[doc = "Servo output 3 value"]
28308 pub servo3_raw: u16,
28309 #[doc = "Servo output 4 value"]
28310 pub servo4_raw: u16,
28311 #[doc = "Servo output 5 value"]
28312 pub servo5_raw: u16,
28313 #[doc = "Servo output 6 value"]
28314 pub servo6_raw: u16,
28315 #[doc = "Servo output 7 value"]
28316 pub servo7_raw: u16,
28317 #[doc = "Servo output 8 value"]
28318 pub servo8_raw: u16,
28319 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
28320 pub port: u8,
28321 #[doc = "Servo output 9 value"]
28322 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28323 pub servo9_raw: u16,
28324 #[doc = "Servo output 10 value"]
28325 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28326 pub servo10_raw: u16,
28327 #[doc = "Servo output 11 value"]
28328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28329 pub servo11_raw: u16,
28330 #[doc = "Servo output 12 value"]
28331 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28332 pub servo12_raw: u16,
28333 #[doc = "Servo output 13 value"]
28334 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28335 pub servo13_raw: u16,
28336 #[doc = "Servo output 14 value"]
28337 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28338 pub servo14_raw: u16,
28339 #[doc = "Servo output 15 value"]
28340 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28341 pub servo15_raw: u16,
28342 #[doc = "Servo output 16 value"]
28343 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28344 pub servo16_raw: u16,
28345}
28346impl SERVO_OUTPUT_RAW_DATA {
28347 pub const ENCODED_LEN: usize = 37usize;
28348 pub const DEFAULT: Self = Self {
28349 time_usec: 0_u32,
28350 servo1_raw: 0_u16,
28351 servo2_raw: 0_u16,
28352 servo3_raw: 0_u16,
28353 servo4_raw: 0_u16,
28354 servo5_raw: 0_u16,
28355 servo6_raw: 0_u16,
28356 servo7_raw: 0_u16,
28357 servo8_raw: 0_u16,
28358 port: 0_u8,
28359 servo9_raw: 0_u16,
28360 servo10_raw: 0_u16,
28361 servo11_raw: 0_u16,
28362 servo12_raw: 0_u16,
28363 servo13_raw: 0_u16,
28364 servo14_raw: 0_u16,
28365 servo15_raw: 0_u16,
28366 servo16_raw: 0_u16,
28367 };
28368 #[cfg(feature = "arbitrary")]
28369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28370 use arbitrary::{Arbitrary, Unstructured};
28371 let mut buf = [0u8; 1024];
28372 rng.fill_bytes(&mut buf);
28373 let mut unstructured = Unstructured::new(&buf);
28374 Self::arbitrary(&mut unstructured).unwrap_or_default()
28375 }
28376}
28377impl Default for SERVO_OUTPUT_RAW_DATA {
28378 fn default() -> Self {
28379 Self::DEFAULT.clone()
28380 }
28381}
28382impl MessageData for SERVO_OUTPUT_RAW_DATA {
28383 type Message = MavMessage;
28384 const ID: u32 = 36u32;
28385 const NAME: &'static str = "SERVO_OUTPUT_RAW";
28386 const EXTRA_CRC: u8 = 222u8;
28387 const ENCODED_LEN: usize = 37usize;
28388 fn deser(
28389 _version: MavlinkVersion,
28390 __input: &[u8],
28391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28392 let avail_len = __input.len();
28393 let mut payload_buf = [0; Self::ENCODED_LEN];
28394 let mut buf = if avail_len < Self::ENCODED_LEN {
28395 payload_buf[0..avail_len].copy_from_slice(__input);
28396 Bytes::new(&payload_buf)
28397 } else {
28398 Bytes::new(__input)
28399 };
28400 let mut __struct = Self::default();
28401 __struct.time_usec = buf.get_u32_le();
28402 __struct.servo1_raw = buf.get_u16_le();
28403 __struct.servo2_raw = buf.get_u16_le();
28404 __struct.servo3_raw = buf.get_u16_le();
28405 __struct.servo4_raw = buf.get_u16_le();
28406 __struct.servo5_raw = buf.get_u16_le();
28407 __struct.servo6_raw = buf.get_u16_le();
28408 __struct.servo7_raw = buf.get_u16_le();
28409 __struct.servo8_raw = buf.get_u16_le();
28410 __struct.port = buf.get_u8();
28411 __struct.servo9_raw = buf.get_u16_le();
28412 __struct.servo10_raw = buf.get_u16_le();
28413 __struct.servo11_raw = buf.get_u16_le();
28414 __struct.servo12_raw = buf.get_u16_le();
28415 __struct.servo13_raw = buf.get_u16_le();
28416 __struct.servo14_raw = buf.get_u16_le();
28417 __struct.servo15_raw = buf.get_u16_le();
28418 __struct.servo16_raw = buf.get_u16_le();
28419 Ok(__struct)
28420 }
28421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28422 let mut __tmp = BytesMut::new(bytes);
28423 #[allow(clippy::absurd_extreme_comparisons)]
28424 #[allow(unused_comparisons)]
28425 if __tmp.remaining() < Self::ENCODED_LEN {
28426 panic!(
28427 "buffer is too small (need {} bytes, but got {})",
28428 Self::ENCODED_LEN,
28429 __tmp.remaining(),
28430 )
28431 }
28432 __tmp.put_u32_le(self.time_usec);
28433 __tmp.put_u16_le(self.servo1_raw);
28434 __tmp.put_u16_le(self.servo2_raw);
28435 __tmp.put_u16_le(self.servo3_raw);
28436 __tmp.put_u16_le(self.servo4_raw);
28437 __tmp.put_u16_le(self.servo5_raw);
28438 __tmp.put_u16_le(self.servo6_raw);
28439 __tmp.put_u16_le(self.servo7_raw);
28440 __tmp.put_u16_le(self.servo8_raw);
28441 __tmp.put_u8(self.port);
28442 __tmp.put_u16_le(self.servo9_raw);
28443 __tmp.put_u16_le(self.servo10_raw);
28444 __tmp.put_u16_le(self.servo11_raw);
28445 __tmp.put_u16_le(self.servo12_raw);
28446 __tmp.put_u16_le(self.servo13_raw);
28447 __tmp.put_u16_le(self.servo14_raw);
28448 __tmp.put_u16_le(self.servo15_raw);
28449 __tmp.put_u16_le(self.servo16_raw);
28450 if matches!(version, MavlinkVersion::V2) {
28451 let len = __tmp.len();
28452 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28453 } else {
28454 __tmp.len()
28455 }
28456 }
28457}
28458#[doc = "id: 256"]
28459#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
28460#[derive(Debug, Clone, PartialEq)]
28461#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28463pub struct SETUP_SIGNING_DATA {
28464 #[doc = "initial timestamp"]
28465 pub initial_timestamp: u64,
28466 #[doc = "system id of the target"]
28467 pub target_system: u8,
28468 #[doc = "component ID of the target"]
28469 pub target_component: u8,
28470 #[doc = "signing key"]
28471 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28472 pub secret_key: [u8; 32],
28473}
28474impl SETUP_SIGNING_DATA {
28475 pub const ENCODED_LEN: usize = 42usize;
28476 pub const DEFAULT: Self = Self {
28477 initial_timestamp: 0_u64,
28478 target_system: 0_u8,
28479 target_component: 0_u8,
28480 secret_key: [0_u8; 32usize],
28481 };
28482 #[cfg(feature = "arbitrary")]
28483 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28484 use arbitrary::{Arbitrary, Unstructured};
28485 let mut buf = [0u8; 1024];
28486 rng.fill_bytes(&mut buf);
28487 let mut unstructured = Unstructured::new(&buf);
28488 Self::arbitrary(&mut unstructured).unwrap_or_default()
28489 }
28490}
28491impl Default for SETUP_SIGNING_DATA {
28492 fn default() -> Self {
28493 Self::DEFAULT.clone()
28494 }
28495}
28496impl MessageData for SETUP_SIGNING_DATA {
28497 type Message = MavMessage;
28498 const ID: u32 = 256u32;
28499 const NAME: &'static str = "SETUP_SIGNING";
28500 const EXTRA_CRC: u8 = 71u8;
28501 const ENCODED_LEN: usize = 42usize;
28502 fn deser(
28503 _version: MavlinkVersion,
28504 __input: &[u8],
28505 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28506 let avail_len = __input.len();
28507 let mut payload_buf = [0; Self::ENCODED_LEN];
28508 let mut buf = if avail_len < Self::ENCODED_LEN {
28509 payload_buf[0..avail_len].copy_from_slice(__input);
28510 Bytes::new(&payload_buf)
28511 } else {
28512 Bytes::new(__input)
28513 };
28514 let mut __struct = Self::default();
28515 __struct.initial_timestamp = buf.get_u64_le();
28516 __struct.target_system = buf.get_u8();
28517 __struct.target_component = buf.get_u8();
28518 for v in &mut __struct.secret_key {
28519 let val = buf.get_u8();
28520 *v = val;
28521 }
28522 Ok(__struct)
28523 }
28524 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28525 let mut __tmp = BytesMut::new(bytes);
28526 #[allow(clippy::absurd_extreme_comparisons)]
28527 #[allow(unused_comparisons)]
28528 if __tmp.remaining() < Self::ENCODED_LEN {
28529 panic!(
28530 "buffer is too small (need {} bytes, but got {})",
28531 Self::ENCODED_LEN,
28532 __tmp.remaining(),
28533 )
28534 }
28535 __tmp.put_u64_le(self.initial_timestamp);
28536 __tmp.put_u8(self.target_system);
28537 __tmp.put_u8(self.target_component);
28538 for val in &self.secret_key {
28539 __tmp.put_u8(*val);
28540 }
28541 if matches!(version, MavlinkVersion::V2) {
28542 let len = __tmp.len();
28543 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28544 } else {
28545 __tmp.len()
28546 }
28547 }
28548}
28549#[doc = "id: 139"]
28550#[doc = "Set the vehicle attitude and body angular rates."]
28551#[derive(Debug, Clone, PartialEq)]
28552#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28553#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28554pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
28555 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28556 pub time_usec: u64,
28557 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
28558 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28559 pub controls: [f32; 8],
28560 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
28561 pub group_mlx: u8,
28562 #[doc = "System ID"]
28563 pub target_system: u8,
28564 #[doc = "Component ID"]
28565 pub target_component: u8,
28566}
28567impl SET_ACTUATOR_CONTROL_TARGET_DATA {
28568 pub const ENCODED_LEN: usize = 43usize;
28569 pub const DEFAULT: Self = Self {
28570 time_usec: 0_u64,
28571 controls: [0.0_f32; 8usize],
28572 group_mlx: 0_u8,
28573 target_system: 0_u8,
28574 target_component: 0_u8,
28575 };
28576 #[cfg(feature = "arbitrary")]
28577 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28578 use arbitrary::{Arbitrary, Unstructured};
28579 let mut buf = [0u8; 1024];
28580 rng.fill_bytes(&mut buf);
28581 let mut unstructured = Unstructured::new(&buf);
28582 Self::arbitrary(&mut unstructured).unwrap_or_default()
28583 }
28584}
28585impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
28586 fn default() -> Self {
28587 Self::DEFAULT.clone()
28588 }
28589}
28590impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
28591 type Message = MavMessage;
28592 const ID: u32 = 139u32;
28593 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
28594 const EXTRA_CRC: u8 = 168u8;
28595 const ENCODED_LEN: usize = 43usize;
28596 fn deser(
28597 _version: MavlinkVersion,
28598 __input: &[u8],
28599 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28600 let avail_len = __input.len();
28601 let mut payload_buf = [0; Self::ENCODED_LEN];
28602 let mut buf = if avail_len < Self::ENCODED_LEN {
28603 payload_buf[0..avail_len].copy_from_slice(__input);
28604 Bytes::new(&payload_buf)
28605 } else {
28606 Bytes::new(__input)
28607 };
28608 let mut __struct = Self::default();
28609 __struct.time_usec = buf.get_u64_le();
28610 for v in &mut __struct.controls {
28611 let val = buf.get_f32_le();
28612 *v = val;
28613 }
28614 __struct.group_mlx = buf.get_u8();
28615 __struct.target_system = buf.get_u8();
28616 __struct.target_component = buf.get_u8();
28617 Ok(__struct)
28618 }
28619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28620 let mut __tmp = BytesMut::new(bytes);
28621 #[allow(clippy::absurd_extreme_comparisons)]
28622 #[allow(unused_comparisons)]
28623 if __tmp.remaining() < Self::ENCODED_LEN {
28624 panic!(
28625 "buffer is too small (need {} bytes, but got {})",
28626 Self::ENCODED_LEN,
28627 __tmp.remaining(),
28628 )
28629 }
28630 __tmp.put_u64_le(self.time_usec);
28631 for val in &self.controls {
28632 __tmp.put_f32_le(*val);
28633 }
28634 __tmp.put_u8(self.group_mlx);
28635 __tmp.put_u8(self.target_system);
28636 __tmp.put_u8(self.target_component);
28637 if matches!(version, MavlinkVersion::V2) {
28638 let len = __tmp.len();
28639 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28640 } else {
28641 __tmp.len()
28642 }
28643 }
28644}
28645#[doc = "id: 82"]
28646#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
28647#[derive(Debug, Clone, PartialEq)]
28648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28650pub struct SET_ATTITUDE_TARGET_DATA {
28651 #[doc = "Timestamp (time since system boot)."]
28652 pub time_boot_ms: u32,
28653 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
28654 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28655 pub q: [f32; 4],
28656 #[doc = "Body roll rate"]
28657 pub body_roll_rate: f32,
28658 #[doc = "Body pitch rate"]
28659 pub body_pitch_rate: f32,
28660 #[doc = "Body yaw rate"]
28661 pub body_yaw_rate: f32,
28662 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
28663 pub thrust: f32,
28664 #[doc = "System ID"]
28665 pub target_system: u8,
28666 #[doc = "Component ID"]
28667 pub target_component: u8,
28668 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28669 pub type_mask: AttitudeTargetTypemask,
28670 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
28671 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28672 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28673 pub thrust_body: [f32; 3],
28674}
28675impl SET_ATTITUDE_TARGET_DATA {
28676 pub const ENCODED_LEN: usize = 51usize;
28677 pub const DEFAULT: Self = Self {
28678 time_boot_ms: 0_u32,
28679 q: [0.0_f32; 4usize],
28680 body_roll_rate: 0.0_f32,
28681 body_pitch_rate: 0.0_f32,
28682 body_yaw_rate: 0.0_f32,
28683 thrust: 0.0_f32,
28684 target_system: 0_u8,
28685 target_component: 0_u8,
28686 type_mask: AttitudeTargetTypemask::DEFAULT,
28687 thrust_body: [0.0_f32; 3usize],
28688 };
28689 #[cfg(feature = "arbitrary")]
28690 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28691 use arbitrary::{Arbitrary, Unstructured};
28692 let mut buf = [0u8; 1024];
28693 rng.fill_bytes(&mut buf);
28694 let mut unstructured = Unstructured::new(&buf);
28695 Self::arbitrary(&mut unstructured).unwrap_or_default()
28696 }
28697}
28698impl Default for SET_ATTITUDE_TARGET_DATA {
28699 fn default() -> Self {
28700 Self::DEFAULT.clone()
28701 }
28702}
28703impl MessageData for SET_ATTITUDE_TARGET_DATA {
28704 type Message = MavMessage;
28705 const ID: u32 = 82u32;
28706 const NAME: &'static str = "SET_ATTITUDE_TARGET";
28707 const EXTRA_CRC: u8 = 49u8;
28708 const ENCODED_LEN: usize = 51usize;
28709 fn deser(
28710 _version: MavlinkVersion,
28711 __input: &[u8],
28712 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28713 let avail_len = __input.len();
28714 let mut payload_buf = [0; Self::ENCODED_LEN];
28715 let mut buf = if avail_len < Self::ENCODED_LEN {
28716 payload_buf[0..avail_len].copy_from_slice(__input);
28717 Bytes::new(&payload_buf)
28718 } else {
28719 Bytes::new(__input)
28720 };
28721 let mut __struct = Self::default();
28722 __struct.time_boot_ms = buf.get_u32_le();
28723 for v in &mut __struct.q {
28724 let val = buf.get_f32_le();
28725 *v = val;
28726 }
28727 __struct.body_roll_rate = buf.get_f32_le();
28728 __struct.body_pitch_rate = buf.get_f32_le();
28729 __struct.body_yaw_rate = buf.get_f32_le();
28730 __struct.thrust = buf.get_f32_le();
28731 __struct.target_system = buf.get_u8();
28732 __struct.target_component = buf.get_u8();
28733 let tmp = buf.get_u8();
28734 __struct.type_mask = AttitudeTargetTypemask::from_bits(
28735 tmp & AttitudeTargetTypemask::all().bits(),
28736 )
28737 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28738 flag_type: "AttitudeTargetTypemask",
28739 value: tmp as u32,
28740 })?;
28741 for v in &mut __struct.thrust_body {
28742 let val = buf.get_f32_le();
28743 *v = val;
28744 }
28745 Ok(__struct)
28746 }
28747 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28748 let mut __tmp = BytesMut::new(bytes);
28749 #[allow(clippy::absurd_extreme_comparisons)]
28750 #[allow(unused_comparisons)]
28751 if __tmp.remaining() < Self::ENCODED_LEN {
28752 panic!(
28753 "buffer is too small (need {} bytes, but got {})",
28754 Self::ENCODED_LEN,
28755 __tmp.remaining(),
28756 )
28757 }
28758 __tmp.put_u32_le(self.time_boot_ms);
28759 for val in &self.q {
28760 __tmp.put_f32_le(*val);
28761 }
28762 __tmp.put_f32_le(self.body_roll_rate);
28763 __tmp.put_f32_le(self.body_pitch_rate);
28764 __tmp.put_f32_le(self.body_yaw_rate);
28765 __tmp.put_f32_le(self.thrust);
28766 __tmp.put_u8(self.target_system);
28767 __tmp.put_u8(self.target_component);
28768 __tmp.put_u8(self.type_mask.bits());
28769 for val in &self.thrust_body {
28770 __tmp.put_f32_le(*val);
28771 }
28772 if matches!(version, MavlinkVersion::V2) {
28773 let len = __tmp.len();
28774 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28775 } else {
28776 __tmp.len()
28777 }
28778 }
28779}
28780#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
28781#[doc = "id: 48"]
28782#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
28783#[derive(Debug, Clone, PartialEq)]
28784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28785#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28786pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
28787 #[doc = "Latitude (WGS84)"]
28788 pub latitude: i32,
28789 #[doc = "Longitude (WGS84)"]
28790 pub longitude: i32,
28791 #[doc = "Altitude (MSL). Positive for up."]
28792 pub altitude: i32,
28793 #[doc = "System ID"]
28794 pub target_system: u8,
28795 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28796 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28797 pub time_usec: u64,
28798}
28799impl SET_GPS_GLOBAL_ORIGIN_DATA {
28800 pub const ENCODED_LEN: usize = 21usize;
28801 pub const DEFAULT: Self = Self {
28802 latitude: 0_i32,
28803 longitude: 0_i32,
28804 altitude: 0_i32,
28805 target_system: 0_u8,
28806 time_usec: 0_u64,
28807 };
28808 #[cfg(feature = "arbitrary")]
28809 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28810 use arbitrary::{Arbitrary, Unstructured};
28811 let mut buf = [0u8; 1024];
28812 rng.fill_bytes(&mut buf);
28813 let mut unstructured = Unstructured::new(&buf);
28814 Self::arbitrary(&mut unstructured).unwrap_or_default()
28815 }
28816}
28817impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28818 fn default() -> Self {
28819 Self::DEFAULT.clone()
28820 }
28821}
28822impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28823 type Message = MavMessage;
28824 const ID: u32 = 48u32;
28825 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28826 const EXTRA_CRC: u8 = 41u8;
28827 const ENCODED_LEN: usize = 21usize;
28828 fn deser(
28829 _version: MavlinkVersion,
28830 __input: &[u8],
28831 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28832 let avail_len = __input.len();
28833 let mut payload_buf = [0; Self::ENCODED_LEN];
28834 let mut buf = if avail_len < Self::ENCODED_LEN {
28835 payload_buf[0..avail_len].copy_from_slice(__input);
28836 Bytes::new(&payload_buf)
28837 } else {
28838 Bytes::new(__input)
28839 };
28840 let mut __struct = Self::default();
28841 __struct.latitude = buf.get_i32_le();
28842 __struct.longitude = buf.get_i32_le();
28843 __struct.altitude = buf.get_i32_le();
28844 __struct.target_system = buf.get_u8();
28845 __struct.time_usec = buf.get_u64_le();
28846 Ok(__struct)
28847 }
28848 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28849 let mut __tmp = BytesMut::new(bytes);
28850 #[allow(clippy::absurd_extreme_comparisons)]
28851 #[allow(unused_comparisons)]
28852 if __tmp.remaining() < Self::ENCODED_LEN {
28853 panic!(
28854 "buffer is too small (need {} bytes, but got {})",
28855 Self::ENCODED_LEN,
28856 __tmp.remaining(),
28857 )
28858 }
28859 __tmp.put_i32_le(self.latitude);
28860 __tmp.put_i32_le(self.longitude);
28861 __tmp.put_i32_le(self.altitude);
28862 __tmp.put_u8(self.target_system);
28863 __tmp.put_u64_le(self.time_usec);
28864 if matches!(version, MavlinkVersion::V2) {
28865 let len = __tmp.len();
28866 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28867 } else {
28868 __tmp.len()
28869 }
28870 }
28871}
28872#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28873#[doc = "id: 243"]
28874#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28875#[derive(Debug, Clone, PartialEq)]
28876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28878pub struct SET_HOME_POSITION_DATA {
28879 #[doc = "Latitude (WGS84)"]
28880 pub latitude: i32,
28881 #[doc = "Longitude (WGS84)"]
28882 pub longitude: i32,
28883 #[doc = "Altitude (MSL). Positive for up."]
28884 pub altitude: i32,
28885 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28886 pub x: f32,
28887 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28888 pub y: f32,
28889 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28890 pub z: f32,
28891 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28892 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28893 pub q: [f32; 4],
28894 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28895 pub approach_x: f32,
28896 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28897 pub approach_y: f32,
28898 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28899 pub approach_z: f32,
28900 #[doc = "System ID."]
28901 pub target_system: u8,
28902 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28903 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28904 pub time_usec: u64,
28905}
28906impl SET_HOME_POSITION_DATA {
28907 pub const ENCODED_LEN: usize = 61usize;
28908 pub const DEFAULT: Self = Self {
28909 latitude: 0_i32,
28910 longitude: 0_i32,
28911 altitude: 0_i32,
28912 x: 0.0_f32,
28913 y: 0.0_f32,
28914 z: 0.0_f32,
28915 q: [0.0_f32; 4usize],
28916 approach_x: 0.0_f32,
28917 approach_y: 0.0_f32,
28918 approach_z: 0.0_f32,
28919 target_system: 0_u8,
28920 time_usec: 0_u64,
28921 };
28922 #[cfg(feature = "arbitrary")]
28923 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28924 use arbitrary::{Arbitrary, Unstructured};
28925 let mut buf = [0u8; 1024];
28926 rng.fill_bytes(&mut buf);
28927 let mut unstructured = Unstructured::new(&buf);
28928 Self::arbitrary(&mut unstructured).unwrap_or_default()
28929 }
28930}
28931impl Default for SET_HOME_POSITION_DATA {
28932 fn default() -> Self {
28933 Self::DEFAULT.clone()
28934 }
28935}
28936impl MessageData for SET_HOME_POSITION_DATA {
28937 type Message = MavMessage;
28938 const ID: u32 = 243u32;
28939 const NAME: &'static str = "SET_HOME_POSITION";
28940 const EXTRA_CRC: u8 = 85u8;
28941 const ENCODED_LEN: usize = 61usize;
28942 fn deser(
28943 _version: MavlinkVersion,
28944 __input: &[u8],
28945 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28946 let avail_len = __input.len();
28947 let mut payload_buf = [0; Self::ENCODED_LEN];
28948 let mut buf = if avail_len < Self::ENCODED_LEN {
28949 payload_buf[0..avail_len].copy_from_slice(__input);
28950 Bytes::new(&payload_buf)
28951 } else {
28952 Bytes::new(__input)
28953 };
28954 let mut __struct = Self::default();
28955 __struct.latitude = buf.get_i32_le();
28956 __struct.longitude = buf.get_i32_le();
28957 __struct.altitude = buf.get_i32_le();
28958 __struct.x = buf.get_f32_le();
28959 __struct.y = buf.get_f32_le();
28960 __struct.z = buf.get_f32_le();
28961 for v in &mut __struct.q {
28962 let val = buf.get_f32_le();
28963 *v = val;
28964 }
28965 __struct.approach_x = buf.get_f32_le();
28966 __struct.approach_y = buf.get_f32_le();
28967 __struct.approach_z = buf.get_f32_le();
28968 __struct.target_system = buf.get_u8();
28969 __struct.time_usec = buf.get_u64_le();
28970 Ok(__struct)
28971 }
28972 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28973 let mut __tmp = BytesMut::new(bytes);
28974 #[allow(clippy::absurd_extreme_comparisons)]
28975 #[allow(unused_comparisons)]
28976 if __tmp.remaining() < Self::ENCODED_LEN {
28977 panic!(
28978 "buffer is too small (need {} bytes, but got {})",
28979 Self::ENCODED_LEN,
28980 __tmp.remaining(),
28981 )
28982 }
28983 __tmp.put_i32_le(self.latitude);
28984 __tmp.put_i32_le(self.longitude);
28985 __tmp.put_i32_le(self.altitude);
28986 __tmp.put_f32_le(self.x);
28987 __tmp.put_f32_le(self.y);
28988 __tmp.put_f32_le(self.z);
28989 for val in &self.q {
28990 __tmp.put_f32_le(*val);
28991 }
28992 __tmp.put_f32_le(self.approach_x);
28993 __tmp.put_f32_le(self.approach_y);
28994 __tmp.put_f32_le(self.approach_z);
28995 __tmp.put_u8(self.target_system);
28996 __tmp.put_u64_le(self.time_usec);
28997 if matches!(version, MavlinkVersion::V2) {
28998 let len = __tmp.len();
28999 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29000 } else {
29001 __tmp.len()
29002 }
29003 }
29004}
29005#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
29006#[doc = "id: 11"]
29007#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
29008#[derive(Debug, Clone, PartialEq)]
29009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29011pub struct SET_MODE_DATA {
29012 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
29013 pub custom_mode: u32,
29014 #[doc = "The system setting the mode"]
29015 pub target_system: u8,
29016 #[doc = "The new base mode."]
29017 pub base_mode: MavMode,
29018}
29019impl SET_MODE_DATA {
29020 pub const ENCODED_LEN: usize = 6usize;
29021 pub const DEFAULT: Self = Self {
29022 custom_mode: 0_u32,
29023 target_system: 0_u8,
29024 base_mode: MavMode::DEFAULT,
29025 };
29026 #[cfg(feature = "arbitrary")]
29027 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29028 use arbitrary::{Arbitrary, Unstructured};
29029 let mut buf = [0u8; 1024];
29030 rng.fill_bytes(&mut buf);
29031 let mut unstructured = Unstructured::new(&buf);
29032 Self::arbitrary(&mut unstructured).unwrap_or_default()
29033 }
29034}
29035impl Default for SET_MODE_DATA {
29036 fn default() -> Self {
29037 Self::DEFAULT.clone()
29038 }
29039}
29040impl MessageData for SET_MODE_DATA {
29041 type Message = MavMessage;
29042 const ID: u32 = 11u32;
29043 const NAME: &'static str = "SET_MODE";
29044 const EXTRA_CRC: u8 = 89u8;
29045 const ENCODED_LEN: usize = 6usize;
29046 fn deser(
29047 _version: MavlinkVersion,
29048 __input: &[u8],
29049 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29050 let avail_len = __input.len();
29051 let mut payload_buf = [0; Self::ENCODED_LEN];
29052 let mut buf = if avail_len < Self::ENCODED_LEN {
29053 payload_buf[0..avail_len].copy_from_slice(__input);
29054 Bytes::new(&payload_buf)
29055 } else {
29056 Bytes::new(__input)
29057 };
29058 let mut __struct = Self::default();
29059 __struct.custom_mode = buf.get_u32_le();
29060 __struct.target_system = buf.get_u8();
29061 let tmp = buf.get_u8();
29062 __struct.base_mode =
29063 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29064 enum_type: "MavMode",
29065 value: tmp as u32,
29066 })?;
29067 Ok(__struct)
29068 }
29069 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29070 let mut __tmp = BytesMut::new(bytes);
29071 #[allow(clippy::absurd_extreme_comparisons)]
29072 #[allow(unused_comparisons)]
29073 if __tmp.remaining() < Self::ENCODED_LEN {
29074 panic!(
29075 "buffer is too small (need {} bytes, but got {})",
29076 Self::ENCODED_LEN,
29077 __tmp.remaining(),
29078 )
29079 }
29080 __tmp.put_u32_le(self.custom_mode);
29081 __tmp.put_u8(self.target_system);
29082 __tmp.put_u8(self.base_mode as u8);
29083 if matches!(version, MavlinkVersion::V2) {
29084 let len = __tmp.len();
29085 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29086 } else {
29087 __tmp.len()
29088 }
29089 }
29090}
29091#[doc = "id: 86"]
29092#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
29093#[derive(Debug, Clone, PartialEq)]
29094#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29095#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29096pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
29097 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
29098 pub time_boot_ms: u32,
29099 #[doc = "Latitude in WGS84 frame"]
29100 pub lat_int: i32,
29101 #[doc = "Longitude in WGS84 frame"]
29102 pub lon_int: i32,
29103 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
29104 pub alt: f32,
29105 #[doc = "X velocity in NED frame"]
29106 pub vx: f32,
29107 #[doc = "Y velocity in NED frame"]
29108 pub vy: f32,
29109 #[doc = "Z velocity in NED frame"]
29110 pub vz: f32,
29111 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29112 pub afx: f32,
29113 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29114 pub afy: f32,
29115 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29116 pub afz: f32,
29117 #[doc = "yaw setpoint"]
29118 pub yaw: f32,
29119 #[doc = "yaw rate setpoint"]
29120 pub yaw_rate: f32,
29121 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
29122 pub type_mask: PositionTargetTypemask,
29123 #[doc = "System ID"]
29124 pub target_system: u8,
29125 #[doc = "Component ID"]
29126 pub target_component: u8,
29127 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
29128 pub coordinate_frame: MavFrame,
29129}
29130impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
29131 pub const ENCODED_LEN: usize = 53usize;
29132 pub const DEFAULT: Self = Self {
29133 time_boot_ms: 0_u32,
29134 lat_int: 0_i32,
29135 lon_int: 0_i32,
29136 alt: 0.0_f32,
29137 vx: 0.0_f32,
29138 vy: 0.0_f32,
29139 vz: 0.0_f32,
29140 afx: 0.0_f32,
29141 afy: 0.0_f32,
29142 afz: 0.0_f32,
29143 yaw: 0.0_f32,
29144 yaw_rate: 0.0_f32,
29145 type_mask: PositionTargetTypemask::DEFAULT,
29146 target_system: 0_u8,
29147 target_component: 0_u8,
29148 coordinate_frame: MavFrame::DEFAULT,
29149 };
29150 #[cfg(feature = "arbitrary")]
29151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29152 use arbitrary::{Arbitrary, Unstructured};
29153 let mut buf = [0u8; 1024];
29154 rng.fill_bytes(&mut buf);
29155 let mut unstructured = Unstructured::new(&buf);
29156 Self::arbitrary(&mut unstructured).unwrap_or_default()
29157 }
29158}
29159impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
29160 fn default() -> Self {
29161 Self::DEFAULT.clone()
29162 }
29163}
29164impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
29165 type Message = MavMessage;
29166 const ID: u32 = 86u32;
29167 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
29168 const EXTRA_CRC: u8 = 5u8;
29169 const ENCODED_LEN: usize = 53usize;
29170 fn deser(
29171 _version: MavlinkVersion,
29172 __input: &[u8],
29173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29174 let avail_len = __input.len();
29175 let mut payload_buf = [0; Self::ENCODED_LEN];
29176 let mut buf = if avail_len < Self::ENCODED_LEN {
29177 payload_buf[0..avail_len].copy_from_slice(__input);
29178 Bytes::new(&payload_buf)
29179 } else {
29180 Bytes::new(__input)
29181 };
29182 let mut __struct = Self::default();
29183 __struct.time_boot_ms = buf.get_u32_le();
29184 __struct.lat_int = buf.get_i32_le();
29185 __struct.lon_int = buf.get_i32_le();
29186 __struct.alt = buf.get_f32_le();
29187 __struct.vx = buf.get_f32_le();
29188 __struct.vy = buf.get_f32_le();
29189 __struct.vz = buf.get_f32_le();
29190 __struct.afx = buf.get_f32_le();
29191 __struct.afy = buf.get_f32_le();
29192 __struct.afz = buf.get_f32_le();
29193 __struct.yaw = buf.get_f32_le();
29194 __struct.yaw_rate = buf.get_f32_le();
29195 let tmp = buf.get_u16_le();
29196 __struct.type_mask = PositionTargetTypemask::from_bits(
29197 tmp & PositionTargetTypemask::all().bits(),
29198 )
29199 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29200 flag_type: "PositionTargetTypemask",
29201 value: tmp as u32,
29202 })?;
29203 __struct.target_system = buf.get_u8();
29204 __struct.target_component = buf.get_u8();
29205 let tmp = buf.get_u8();
29206 __struct.coordinate_frame =
29207 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29208 enum_type: "MavFrame",
29209 value: tmp as u32,
29210 })?;
29211 Ok(__struct)
29212 }
29213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29214 let mut __tmp = BytesMut::new(bytes);
29215 #[allow(clippy::absurd_extreme_comparisons)]
29216 #[allow(unused_comparisons)]
29217 if __tmp.remaining() < Self::ENCODED_LEN {
29218 panic!(
29219 "buffer is too small (need {} bytes, but got {})",
29220 Self::ENCODED_LEN,
29221 __tmp.remaining(),
29222 )
29223 }
29224 __tmp.put_u32_le(self.time_boot_ms);
29225 __tmp.put_i32_le(self.lat_int);
29226 __tmp.put_i32_le(self.lon_int);
29227 __tmp.put_f32_le(self.alt);
29228 __tmp.put_f32_le(self.vx);
29229 __tmp.put_f32_le(self.vy);
29230 __tmp.put_f32_le(self.vz);
29231 __tmp.put_f32_le(self.afx);
29232 __tmp.put_f32_le(self.afy);
29233 __tmp.put_f32_le(self.afz);
29234 __tmp.put_f32_le(self.yaw);
29235 __tmp.put_f32_le(self.yaw_rate);
29236 __tmp.put_u16_le(self.type_mask.bits());
29237 __tmp.put_u8(self.target_system);
29238 __tmp.put_u8(self.target_component);
29239 __tmp.put_u8(self.coordinate_frame as u8);
29240 if matches!(version, MavlinkVersion::V2) {
29241 let len = __tmp.len();
29242 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29243 } else {
29244 __tmp.len()
29245 }
29246 }
29247}
29248#[doc = "id: 84"]
29249#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
29250#[derive(Debug, Clone, PartialEq)]
29251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29252#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29253pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
29254 #[doc = "Timestamp (time since system boot)."]
29255 pub time_boot_ms: u32,
29256 #[doc = "X Position in NED frame"]
29257 pub x: f32,
29258 #[doc = "Y Position in NED frame"]
29259 pub y: f32,
29260 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
29261 pub z: f32,
29262 #[doc = "X velocity in NED frame"]
29263 pub vx: f32,
29264 #[doc = "Y velocity in NED frame"]
29265 pub vy: f32,
29266 #[doc = "Z velocity in NED frame"]
29267 pub vz: f32,
29268 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29269 pub afx: f32,
29270 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29271 pub afy: f32,
29272 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29273 pub afz: f32,
29274 #[doc = "yaw setpoint"]
29275 pub yaw: f32,
29276 #[doc = "yaw rate setpoint"]
29277 pub yaw_rate: f32,
29278 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
29279 pub type_mask: PositionTargetTypemask,
29280 #[doc = "System ID"]
29281 pub target_system: u8,
29282 #[doc = "Component ID"]
29283 pub target_component: u8,
29284 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
29285 pub coordinate_frame: MavFrame,
29286}
29287impl SET_POSITION_TARGET_LOCAL_NED_DATA {
29288 pub const ENCODED_LEN: usize = 53usize;
29289 pub const DEFAULT: Self = Self {
29290 time_boot_ms: 0_u32,
29291 x: 0.0_f32,
29292 y: 0.0_f32,
29293 z: 0.0_f32,
29294 vx: 0.0_f32,
29295 vy: 0.0_f32,
29296 vz: 0.0_f32,
29297 afx: 0.0_f32,
29298 afy: 0.0_f32,
29299 afz: 0.0_f32,
29300 yaw: 0.0_f32,
29301 yaw_rate: 0.0_f32,
29302 type_mask: PositionTargetTypemask::DEFAULT,
29303 target_system: 0_u8,
29304 target_component: 0_u8,
29305 coordinate_frame: MavFrame::DEFAULT,
29306 };
29307 #[cfg(feature = "arbitrary")]
29308 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29309 use arbitrary::{Arbitrary, Unstructured};
29310 let mut buf = [0u8; 1024];
29311 rng.fill_bytes(&mut buf);
29312 let mut unstructured = Unstructured::new(&buf);
29313 Self::arbitrary(&mut unstructured).unwrap_or_default()
29314 }
29315}
29316impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
29317 fn default() -> Self {
29318 Self::DEFAULT.clone()
29319 }
29320}
29321impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
29322 type Message = MavMessage;
29323 const ID: u32 = 84u32;
29324 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
29325 const EXTRA_CRC: u8 = 143u8;
29326 const ENCODED_LEN: usize = 53usize;
29327 fn deser(
29328 _version: MavlinkVersion,
29329 __input: &[u8],
29330 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29331 let avail_len = __input.len();
29332 let mut payload_buf = [0; Self::ENCODED_LEN];
29333 let mut buf = if avail_len < Self::ENCODED_LEN {
29334 payload_buf[0..avail_len].copy_from_slice(__input);
29335 Bytes::new(&payload_buf)
29336 } else {
29337 Bytes::new(__input)
29338 };
29339 let mut __struct = Self::default();
29340 __struct.time_boot_ms = buf.get_u32_le();
29341 __struct.x = buf.get_f32_le();
29342 __struct.y = buf.get_f32_le();
29343 __struct.z = buf.get_f32_le();
29344 __struct.vx = buf.get_f32_le();
29345 __struct.vy = buf.get_f32_le();
29346 __struct.vz = buf.get_f32_le();
29347 __struct.afx = buf.get_f32_le();
29348 __struct.afy = buf.get_f32_le();
29349 __struct.afz = buf.get_f32_le();
29350 __struct.yaw = buf.get_f32_le();
29351 __struct.yaw_rate = buf.get_f32_le();
29352 let tmp = buf.get_u16_le();
29353 __struct.type_mask = PositionTargetTypemask::from_bits(
29354 tmp & PositionTargetTypemask::all().bits(),
29355 )
29356 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29357 flag_type: "PositionTargetTypemask",
29358 value: tmp as u32,
29359 })?;
29360 __struct.target_system = buf.get_u8();
29361 __struct.target_component = buf.get_u8();
29362 let tmp = buf.get_u8();
29363 __struct.coordinate_frame =
29364 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29365 enum_type: "MavFrame",
29366 value: tmp as u32,
29367 })?;
29368 Ok(__struct)
29369 }
29370 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29371 let mut __tmp = BytesMut::new(bytes);
29372 #[allow(clippy::absurd_extreme_comparisons)]
29373 #[allow(unused_comparisons)]
29374 if __tmp.remaining() < Self::ENCODED_LEN {
29375 panic!(
29376 "buffer is too small (need {} bytes, but got {})",
29377 Self::ENCODED_LEN,
29378 __tmp.remaining(),
29379 )
29380 }
29381 __tmp.put_u32_le(self.time_boot_ms);
29382 __tmp.put_f32_le(self.x);
29383 __tmp.put_f32_le(self.y);
29384 __tmp.put_f32_le(self.z);
29385 __tmp.put_f32_le(self.vx);
29386 __tmp.put_f32_le(self.vy);
29387 __tmp.put_f32_le(self.vz);
29388 __tmp.put_f32_le(self.afx);
29389 __tmp.put_f32_le(self.afy);
29390 __tmp.put_f32_le(self.afz);
29391 __tmp.put_f32_le(self.yaw);
29392 __tmp.put_f32_le(self.yaw_rate);
29393 __tmp.put_u16_le(self.type_mask.bits());
29394 __tmp.put_u8(self.target_system);
29395 __tmp.put_u8(self.target_component);
29396 __tmp.put_u8(self.coordinate_frame as u8);
29397 if matches!(version, MavlinkVersion::V2) {
29398 let len = __tmp.len();
29399 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29400 } else {
29401 __tmp.len()
29402 }
29403 }
29404}
29405#[doc = "id: 108"]
29406#[doc = "Status of simulation environment, if used."]
29407#[derive(Debug, Clone, PartialEq)]
29408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29410pub struct SIM_STATE_DATA {
29411 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
29412 pub q1: f32,
29413 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
29414 pub q2: f32,
29415 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
29416 pub q3: f32,
29417 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
29418 pub q4: f32,
29419 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
29420 pub roll: f32,
29421 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
29422 pub pitch: f32,
29423 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
29424 pub yaw: f32,
29425 #[doc = "X acceleration"]
29426 pub xacc: f32,
29427 #[doc = "Y acceleration"]
29428 pub yacc: f32,
29429 #[doc = "Z acceleration"]
29430 pub zacc: f32,
29431 #[doc = "Angular speed around X axis"]
29432 pub xgyro: f32,
29433 #[doc = "Angular speed around Y axis"]
29434 pub ygyro: f32,
29435 #[doc = "Angular speed around Z axis"]
29436 pub zgyro: f32,
29437 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
29438 pub lat: f32,
29439 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
29440 pub lon: f32,
29441 #[doc = "Altitude"]
29442 pub alt: f32,
29443 #[doc = "Horizontal position standard deviation"]
29444 pub std_dev_horz: f32,
29445 #[doc = "Vertical position standard deviation"]
29446 pub std_dev_vert: f32,
29447 #[doc = "True velocity in north direction in earth-fixed NED frame"]
29448 pub vn: f32,
29449 #[doc = "True velocity in east direction in earth-fixed NED frame"]
29450 pub ve: f32,
29451 #[doc = "True velocity in down direction in earth-fixed NED frame"]
29452 pub vd: f32,
29453 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
29454 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29455 pub lat_int: i32,
29456 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
29457 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29458 pub lon_int: i32,
29459}
29460impl SIM_STATE_DATA {
29461 pub const ENCODED_LEN: usize = 92usize;
29462 pub const DEFAULT: Self = Self {
29463 q1: 0.0_f32,
29464 q2: 0.0_f32,
29465 q3: 0.0_f32,
29466 q4: 0.0_f32,
29467 roll: 0.0_f32,
29468 pitch: 0.0_f32,
29469 yaw: 0.0_f32,
29470 xacc: 0.0_f32,
29471 yacc: 0.0_f32,
29472 zacc: 0.0_f32,
29473 xgyro: 0.0_f32,
29474 ygyro: 0.0_f32,
29475 zgyro: 0.0_f32,
29476 lat: 0.0_f32,
29477 lon: 0.0_f32,
29478 alt: 0.0_f32,
29479 std_dev_horz: 0.0_f32,
29480 std_dev_vert: 0.0_f32,
29481 vn: 0.0_f32,
29482 ve: 0.0_f32,
29483 vd: 0.0_f32,
29484 lat_int: 0_i32,
29485 lon_int: 0_i32,
29486 };
29487 #[cfg(feature = "arbitrary")]
29488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29489 use arbitrary::{Arbitrary, Unstructured};
29490 let mut buf = [0u8; 1024];
29491 rng.fill_bytes(&mut buf);
29492 let mut unstructured = Unstructured::new(&buf);
29493 Self::arbitrary(&mut unstructured).unwrap_or_default()
29494 }
29495}
29496impl Default for SIM_STATE_DATA {
29497 fn default() -> Self {
29498 Self::DEFAULT.clone()
29499 }
29500}
29501impl MessageData for SIM_STATE_DATA {
29502 type Message = MavMessage;
29503 const ID: u32 = 108u32;
29504 const NAME: &'static str = "SIM_STATE";
29505 const EXTRA_CRC: u8 = 32u8;
29506 const ENCODED_LEN: usize = 92usize;
29507 fn deser(
29508 _version: MavlinkVersion,
29509 __input: &[u8],
29510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29511 let avail_len = __input.len();
29512 let mut payload_buf = [0; Self::ENCODED_LEN];
29513 let mut buf = if avail_len < Self::ENCODED_LEN {
29514 payload_buf[0..avail_len].copy_from_slice(__input);
29515 Bytes::new(&payload_buf)
29516 } else {
29517 Bytes::new(__input)
29518 };
29519 let mut __struct = Self::default();
29520 __struct.q1 = buf.get_f32_le();
29521 __struct.q2 = buf.get_f32_le();
29522 __struct.q3 = buf.get_f32_le();
29523 __struct.q4 = buf.get_f32_le();
29524 __struct.roll = buf.get_f32_le();
29525 __struct.pitch = buf.get_f32_le();
29526 __struct.yaw = buf.get_f32_le();
29527 __struct.xacc = buf.get_f32_le();
29528 __struct.yacc = buf.get_f32_le();
29529 __struct.zacc = buf.get_f32_le();
29530 __struct.xgyro = buf.get_f32_le();
29531 __struct.ygyro = buf.get_f32_le();
29532 __struct.zgyro = buf.get_f32_le();
29533 __struct.lat = buf.get_f32_le();
29534 __struct.lon = buf.get_f32_le();
29535 __struct.alt = buf.get_f32_le();
29536 __struct.std_dev_horz = buf.get_f32_le();
29537 __struct.std_dev_vert = buf.get_f32_le();
29538 __struct.vn = buf.get_f32_le();
29539 __struct.ve = buf.get_f32_le();
29540 __struct.vd = buf.get_f32_le();
29541 __struct.lat_int = buf.get_i32_le();
29542 __struct.lon_int = buf.get_i32_le();
29543 Ok(__struct)
29544 }
29545 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29546 let mut __tmp = BytesMut::new(bytes);
29547 #[allow(clippy::absurd_extreme_comparisons)]
29548 #[allow(unused_comparisons)]
29549 if __tmp.remaining() < Self::ENCODED_LEN {
29550 panic!(
29551 "buffer is too small (need {} bytes, but got {})",
29552 Self::ENCODED_LEN,
29553 __tmp.remaining(),
29554 )
29555 }
29556 __tmp.put_f32_le(self.q1);
29557 __tmp.put_f32_le(self.q2);
29558 __tmp.put_f32_le(self.q3);
29559 __tmp.put_f32_le(self.q4);
29560 __tmp.put_f32_le(self.roll);
29561 __tmp.put_f32_le(self.pitch);
29562 __tmp.put_f32_le(self.yaw);
29563 __tmp.put_f32_le(self.xacc);
29564 __tmp.put_f32_le(self.yacc);
29565 __tmp.put_f32_le(self.zacc);
29566 __tmp.put_f32_le(self.xgyro);
29567 __tmp.put_f32_le(self.ygyro);
29568 __tmp.put_f32_le(self.zgyro);
29569 __tmp.put_f32_le(self.lat);
29570 __tmp.put_f32_le(self.lon);
29571 __tmp.put_f32_le(self.alt);
29572 __tmp.put_f32_le(self.std_dev_horz);
29573 __tmp.put_f32_le(self.std_dev_vert);
29574 __tmp.put_f32_le(self.vn);
29575 __tmp.put_f32_le(self.ve);
29576 __tmp.put_f32_le(self.vd);
29577 __tmp.put_i32_le(self.lat_int);
29578 __tmp.put_i32_le(self.lon_int);
29579 if matches!(version, MavlinkVersion::V2) {
29580 let len = __tmp.len();
29581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29582 } else {
29583 __tmp.len()
29584 }
29585 }
29586}
29587#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
29588#[doc = "id: 370"]
29589#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
29590#[derive(Debug, Clone, PartialEq)]
29591#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29592#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29593pub struct SMART_BATTERY_INFO_DATA {
29594 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
29595 pub capacity_full_specification: i32,
29596 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
29597 pub capacity_full: i32,
29598 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
29599 pub cycle_count: u16,
29600 #[doc = "Battery weight. 0: field not provided."]
29601 pub weight: u16,
29602 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
29603 pub discharge_minimum_voltage: u16,
29604 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
29605 pub charging_minimum_voltage: u16,
29606 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
29607 pub resting_minimum_voltage: u16,
29608 #[doc = "Battery ID"]
29609 pub id: u8,
29610 #[doc = "Function of the battery"]
29611 pub battery_function: MavBatteryFunction,
29612 #[doc = "Type (chemistry) of the battery"]
29613 pub mavtype: MavBatteryType,
29614 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
29615 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29616 pub serial_number: [u8; 16],
29617 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
29618 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29619 pub device_name: [u8; 50],
29620 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
29621 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29622 pub charging_maximum_voltage: u16,
29623 #[doc = "Number of battery cells in series. 0: field not provided."]
29624 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29625 pub cells_in_series: u8,
29626 #[doc = "Maximum pack discharge current. 0: field not provided."]
29627 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29628 pub discharge_maximum_current: u32,
29629 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
29630 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29631 pub discharge_maximum_burst_current: u32,
29632 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
29633 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29634 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29635 pub manufacture_date: [u8; 11],
29636}
29637impl SMART_BATTERY_INFO_DATA {
29638 pub const ENCODED_LEN: usize = 109usize;
29639 pub const DEFAULT: Self = Self {
29640 capacity_full_specification: 0_i32,
29641 capacity_full: 0_i32,
29642 cycle_count: 0_u16,
29643 weight: 0_u16,
29644 discharge_minimum_voltage: 0_u16,
29645 charging_minimum_voltage: 0_u16,
29646 resting_minimum_voltage: 0_u16,
29647 id: 0_u8,
29648 battery_function: MavBatteryFunction::DEFAULT,
29649 mavtype: MavBatteryType::DEFAULT,
29650 serial_number: [0_u8; 16usize],
29651 device_name: [0_u8; 50usize],
29652 charging_maximum_voltage: 0_u16,
29653 cells_in_series: 0_u8,
29654 discharge_maximum_current: 0_u32,
29655 discharge_maximum_burst_current: 0_u32,
29656 manufacture_date: [0_u8; 11usize],
29657 };
29658 #[cfg(feature = "arbitrary")]
29659 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29660 use arbitrary::{Arbitrary, Unstructured};
29661 let mut buf = [0u8; 1024];
29662 rng.fill_bytes(&mut buf);
29663 let mut unstructured = Unstructured::new(&buf);
29664 Self::arbitrary(&mut unstructured).unwrap_or_default()
29665 }
29666}
29667impl Default for SMART_BATTERY_INFO_DATA {
29668 fn default() -> Self {
29669 Self::DEFAULT.clone()
29670 }
29671}
29672impl MessageData for SMART_BATTERY_INFO_DATA {
29673 type Message = MavMessage;
29674 const ID: u32 = 370u32;
29675 const NAME: &'static str = "SMART_BATTERY_INFO";
29676 const EXTRA_CRC: u8 = 75u8;
29677 const ENCODED_LEN: usize = 109usize;
29678 fn deser(
29679 _version: MavlinkVersion,
29680 __input: &[u8],
29681 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29682 let avail_len = __input.len();
29683 let mut payload_buf = [0; Self::ENCODED_LEN];
29684 let mut buf = if avail_len < Self::ENCODED_LEN {
29685 payload_buf[0..avail_len].copy_from_slice(__input);
29686 Bytes::new(&payload_buf)
29687 } else {
29688 Bytes::new(__input)
29689 };
29690 let mut __struct = Self::default();
29691 __struct.capacity_full_specification = buf.get_i32_le();
29692 __struct.capacity_full = buf.get_i32_le();
29693 __struct.cycle_count = buf.get_u16_le();
29694 __struct.weight = buf.get_u16_le();
29695 __struct.discharge_minimum_voltage = buf.get_u16_le();
29696 __struct.charging_minimum_voltage = buf.get_u16_le();
29697 __struct.resting_minimum_voltage = buf.get_u16_le();
29698 __struct.id = buf.get_u8();
29699 let tmp = buf.get_u8();
29700 __struct.battery_function =
29701 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29702 enum_type: "MavBatteryFunction",
29703 value: tmp as u32,
29704 })?;
29705 let tmp = buf.get_u8();
29706 __struct.mavtype =
29707 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29708 enum_type: "MavBatteryType",
29709 value: tmp as u32,
29710 })?;
29711 for v in &mut __struct.serial_number {
29712 let val = buf.get_u8();
29713 *v = val;
29714 }
29715 for v in &mut __struct.device_name {
29716 let val = buf.get_u8();
29717 *v = val;
29718 }
29719 __struct.charging_maximum_voltage = buf.get_u16_le();
29720 __struct.cells_in_series = buf.get_u8();
29721 __struct.discharge_maximum_current = buf.get_u32_le();
29722 __struct.discharge_maximum_burst_current = buf.get_u32_le();
29723 for v in &mut __struct.manufacture_date {
29724 let val = buf.get_u8();
29725 *v = val;
29726 }
29727 Ok(__struct)
29728 }
29729 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29730 let mut __tmp = BytesMut::new(bytes);
29731 #[allow(clippy::absurd_extreme_comparisons)]
29732 #[allow(unused_comparisons)]
29733 if __tmp.remaining() < Self::ENCODED_LEN {
29734 panic!(
29735 "buffer is too small (need {} bytes, but got {})",
29736 Self::ENCODED_LEN,
29737 __tmp.remaining(),
29738 )
29739 }
29740 __tmp.put_i32_le(self.capacity_full_specification);
29741 __tmp.put_i32_le(self.capacity_full);
29742 __tmp.put_u16_le(self.cycle_count);
29743 __tmp.put_u16_le(self.weight);
29744 __tmp.put_u16_le(self.discharge_minimum_voltage);
29745 __tmp.put_u16_le(self.charging_minimum_voltage);
29746 __tmp.put_u16_le(self.resting_minimum_voltage);
29747 __tmp.put_u8(self.id);
29748 __tmp.put_u8(self.battery_function as u8);
29749 __tmp.put_u8(self.mavtype as u8);
29750 for val in &self.serial_number {
29751 __tmp.put_u8(*val);
29752 }
29753 for val in &self.device_name {
29754 __tmp.put_u8(*val);
29755 }
29756 __tmp.put_u16_le(self.charging_maximum_voltage);
29757 __tmp.put_u8(self.cells_in_series);
29758 __tmp.put_u32_le(self.discharge_maximum_current);
29759 __tmp.put_u32_le(self.discharge_maximum_burst_current);
29760 for val in &self.manufacture_date {
29761 __tmp.put_u8(*val);
29762 }
29763 if matches!(version, MavlinkVersion::V2) {
29764 let len = __tmp.len();
29765 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29766 } else {
29767 __tmp.len()
29768 }
29769 }
29770}
29771#[doc = "id: 253"]
29772#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
29773#[derive(Debug, Clone, PartialEq)]
29774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29776pub struct STATUSTEXT_DATA {
29777 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
29778 pub severity: MavSeverity,
29779 #[doc = "Status text message, without null termination character"]
29780 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29781 pub text: [u8; 50],
29782 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
29783 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29784 pub id: u16,
29785 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
29786 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29787 pub chunk_seq: u8,
29788}
29789impl STATUSTEXT_DATA {
29790 pub const ENCODED_LEN: usize = 54usize;
29791 pub const DEFAULT: Self = Self {
29792 severity: MavSeverity::DEFAULT,
29793 text: [0_u8; 50usize],
29794 id: 0_u16,
29795 chunk_seq: 0_u8,
29796 };
29797 #[cfg(feature = "arbitrary")]
29798 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29799 use arbitrary::{Arbitrary, Unstructured};
29800 let mut buf = [0u8; 1024];
29801 rng.fill_bytes(&mut buf);
29802 let mut unstructured = Unstructured::new(&buf);
29803 Self::arbitrary(&mut unstructured).unwrap_or_default()
29804 }
29805}
29806impl Default for STATUSTEXT_DATA {
29807 fn default() -> Self {
29808 Self::DEFAULT.clone()
29809 }
29810}
29811impl MessageData for STATUSTEXT_DATA {
29812 type Message = MavMessage;
29813 const ID: u32 = 253u32;
29814 const NAME: &'static str = "STATUSTEXT";
29815 const EXTRA_CRC: u8 = 83u8;
29816 const ENCODED_LEN: usize = 54usize;
29817 fn deser(
29818 _version: MavlinkVersion,
29819 __input: &[u8],
29820 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29821 let avail_len = __input.len();
29822 let mut payload_buf = [0; Self::ENCODED_LEN];
29823 let mut buf = if avail_len < Self::ENCODED_LEN {
29824 payload_buf[0..avail_len].copy_from_slice(__input);
29825 Bytes::new(&payload_buf)
29826 } else {
29827 Bytes::new(__input)
29828 };
29829 let mut __struct = Self::default();
29830 let tmp = buf.get_u8();
29831 __struct.severity =
29832 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29833 enum_type: "MavSeverity",
29834 value: tmp as u32,
29835 })?;
29836 for v in &mut __struct.text {
29837 let val = buf.get_u8();
29838 *v = val;
29839 }
29840 __struct.id = buf.get_u16_le();
29841 __struct.chunk_seq = buf.get_u8();
29842 Ok(__struct)
29843 }
29844 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29845 let mut __tmp = BytesMut::new(bytes);
29846 #[allow(clippy::absurd_extreme_comparisons)]
29847 #[allow(unused_comparisons)]
29848 if __tmp.remaining() < Self::ENCODED_LEN {
29849 panic!(
29850 "buffer is too small (need {} bytes, but got {})",
29851 Self::ENCODED_LEN,
29852 __tmp.remaining(),
29853 )
29854 }
29855 __tmp.put_u8(self.severity as u8);
29856 for val in &self.text {
29857 __tmp.put_u8(*val);
29858 }
29859 __tmp.put_u16_le(self.id);
29860 __tmp.put_u8(self.chunk_seq);
29861 if matches!(version, MavlinkVersion::V2) {
29862 let len = __tmp.len();
29863 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29864 } else {
29865 __tmp.len()
29866 }
29867 }
29868}
29869#[doc = "id: 261"]
29870#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29871#[derive(Debug, Clone, PartialEq)]
29872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29874pub struct STORAGE_INFORMATION_DATA {
29875 #[doc = "Timestamp (time since system boot)."]
29876 pub time_boot_ms: u32,
29877 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29878 pub total_capacity: f32,
29879 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29880 pub used_capacity: f32,
29881 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29882 pub available_capacity: f32,
29883 #[doc = "Read speed."]
29884 pub read_speed: f32,
29885 #[doc = "Write speed."]
29886 pub write_speed: f32,
29887 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29888 pub storage_id: u8,
29889 #[doc = "Number of storage devices"]
29890 pub storage_count: u8,
29891 #[doc = "Status of storage"]
29892 pub status: StorageStatus,
29893 #[doc = "Type of storage"]
29894 #[cfg_attr(feature = "serde", serde(default))]
29895 pub mavtype: StorageType,
29896 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29897 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29898 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29899 pub name: [u8; 32],
29900 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29901 #[cfg_attr(feature = "serde", serde(default))]
29902 pub storage_usage: StorageUsageFlag,
29903}
29904impl STORAGE_INFORMATION_DATA {
29905 pub const ENCODED_LEN: usize = 61usize;
29906 pub const DEFAULT: Self = Self {
29907 time_boot_ms: 0_u32,
29908 total_capacity: 0.0_f32,
29909 used_capacity: 0.0_f32,
29910 available_capacity: 0.0_f32,
29911 read_speed: 0.0_f32,
29912 write_speed: 0.0_f32,
29913 storage_id: 0_u8,
29914 storage_count: 0_u8,
29915 status: StorageStatus::DEFAULT,
29916 mavtype: StorageType::DEFAULT,
29917 name: [0_u8; 32usize],
29918 storage_usage: StorageUsageFlag::DEFAULT,
29919 };
29920 #[cfg(feature = "arbitrary")]
29921 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29922 use arbitrary::{Arbitrary, Unstructured};
29923 let mut buf = [0u8; 1024];
29924 rng.fill_bytes(&mut buf);
29925 let mut unstructured = Unstructured::new(&buf);
29926 Self::arbitrary(&mut unstructured).unwrap_or_default()
29927 }
29928}
29929impl Default for STORAGE_INFORMATION_DATA {
29930 fn default() -> Self {
29931 Self::DEFAULT.clone()
29932 }
29933}
29934impl MessageData for STORAGE_INFORMATION_DATA {
29935 type Message = MavMessage;
29936 const ID: u32 = 261u32;
29937 const NAME: &'static str = "STORAGE_INFORMATION";
29938 const EXTRA_CRC: u8 = 179u8;
29939 const ENCODED_LEN: usize = 61usize;
29940 fn deser(
29941 _version: MavlinkVersion,
29942 __input: &[u8],
29943 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29944 let avail_len = __input.len();
29945 let mut payload_buf = [0; Self::ENCODED_LEN];
29946 let mut buf = if avail_len < Self::ENCODED_LEN {
29947 payload_buf[0..avail_len].copy_from_slice(__input);
29948 Bytes::new(&payload_buf)
29949 } else {
29950 Bytes::new(__input)
29951 };
29952 let mut __struct = Self::default();
29953 __struct.time_boot_ms = buf.get_u32_le();
29954 __struct.total_capacity = buf.get_f32_le();
29955 __struct.used_capacity = buf.get_f32_le();
29956 __struct.available_capacity = buf.get_f32_le();
29957 __struct.read_speed = buf.get_f32_le();
29958 __struct.write_speed = buf.get_f32_le();
29959 __struct.storage_id = buf.get_u8();
29960 __struct.storage_count = buf.get_u8();
29961 let tmp = buf.get_u8();
29962 __struct.status =
29963 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29964 enum_type: "StorageStatus",
29965 value: tmp as u32,
29966 })?;
29967 let tmp = buf.get_u8();
29968 __struct.mavtype =
29969 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29970 enum_type: "StorageType",
29971 value: tmp as u32,
29972 })?;
29973 for v in &mut __struct.name {
29974 let val = buf.get_u8();
29975 *v = val;
29976 }
29977 let tmp = buf.get_u8();
29978 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
29979 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29980 flag_type: "StorageUsageFlag",
29981 value: tmp as u32,
29982 })?;
29983 Ok(__struct)
29984 }
29985 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29986 let mut __tmp = BytesMut::new(bytes);
29987 #[allow(clippy::absurd_extreme_comparisons)]
29988 #[allow(unused_comparisons)]
29989 if __tmp.remaining() < Self::ENCODED_LEN {
29990 panic!(
29991 "buffer is too small (need {} bytes, but got {})",
29992 Self::ENCODED_LEN,
29993 __tmp.remaining(),
29994 )
29995 }
29996 __tmp.put_u32_le(self.time_boot_ms);
29997 __tmp.put_f32_le(self.total_capacity);
29998 __tmp.put_f32_le(self.used_capacity);
29999 __tmp.put_f32_le(self.available_capacity);
30000 __tmp.put_f32_le(self.read_speed);
30001 __tmp.put_f32_le(self.write_speed);
30002 __tmp.put_u8(self.storage_id);
30003 __tmp.put_u8(self.storage_count);
30004 __tmp.put_u8(self.status as u8);
30005 __tmp.put_u8(self.mavtype as u8);
30006 for val in &self.name {
30007 __tmp.put_u8(*val);
30008 }
30009 __tmp.put_u8(self.storage_usage.bits());
30010 if matches!(version, MavlinkVersion::V2) {
30011 let len = __tmp.len();
30012 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30013 } else {
30014 __tmp.len()
30015 }
30016 }
30017}
30018#[doc = "id: 401"]
30019#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
30020#[derive(Debug, Clone, PartialEq)]
30021#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30022#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30023pub struct SUPPORTED_TUNES_DATA {
30024 #[doc = "Bitfield of supported tune formats."]
30025 pub format: TuneFormat,
30026 #[doc = "System ID"]
30027 pub target_system: u8,
30028 #[doc = "Component ID"]
30029 pub target_component: u8,
30030}
30031impl SUPPORTED_TUNES_DATA {
30032 pub const ENCODED_LEN: usize = 6usize;
30033 pub const DEFAULT: Self = Self {
30034 format: TuneFormat::DEFAULT,
30035 target_system: 0_u8,
30036 target_component: 0_u8,
30037 };
30038 #[cfg(feature = "arbitrary")]
30039 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30040 use arbitrary::{Arbitrary, Unstructured};
30041 let mut buf = [0u8; 1024];
30042 rng.fill_bytes(&mut buf);
30043 let mut unstructured = Unstructured::new(&buf);
30044 Self::arbitrary(&mut unstructured).unwrap_or_default()
30045 }
30046}
30047impl Default for SUPPORTED_TUNES_DATA {
30048 fn default() -> Self {
30049 Self::DEFAULT.clone()
30050 }
30051}
30052impl MessageData for SUPPORTED_TUNES_DATA {
30053 type Message = MavMessage;
30054 const ID: u32 = 401u32;
30055 const NAME: &'static str = "SUPPORTED_TUNES";
30056 const EXTRA_CRC: u8 = 183u8;
30057 const ENCODED_LEN: usize = 6usize;
30058 fn deser(
30059 _version: MavlinkVersion,
30060 __input: &[u8],
30061 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30062 let avail_len = __input.len();
30063 let mut payload_buf = [0; Self::ENCODED_LEN];
30064 let mut buf = if avail_len < Self::ENCODED_LEN {
30065 payload_buf[0..avail_len].copy_from_slice(__input);
30066 Bytes::new(&payload_buf)
30067 } else {
30068 Bytes::new(__input)
30069 };
30070 let mut __struct = Self::default();
30071 let tmp = buf.get_u32_le();
30072 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
30073 ::mavlink_core::error::ParserError::InvalidEnum {
30074 enum_type: "TuneFormat",
30075 value: tmp as u32,
30076 },
30077 )?;
30078 __struct.target_system = buf.get_u8();
30079 __struct.target_component = buf.get_u8();
30080 Ok(__struct)
30081 }
30082 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30083 let mut __tmp = BytesMut::new(bytes);
30084 #[allow(clippy::absurd_extreme_comparisons)]
30085 #[allow(unused_comparisons)]
30086 if __tmp.remaining() < Self::ENCODED_LEN {
30087 panic!(
30088 "buffer is too small (need {} bytes, but got {})",
30089 Self::ENCODED_LEN,
30090 __tmp.remaining(),
30091 )
30092 }
30093 __tmp.put_u32_le(self.format as u32);
30094 __tmp.put_u8(self.target_system);
30095 __tmp.put_u8(self.target_component);
30096 if matches!(version, MavlinkVersion::V2) {
30097 let len = __tmp.len();
30098 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30099 } else {
30100 __tmp.len()
30101 }
30102 }
30103}
30104#[doc = "id: 2"]
30105#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
30106#[derive(Debug, Clone, PartialEq)]
30107#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30108#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30109pub struct SYSTEM_TIME_DATA {
30110 #[doc = "Timestamp (UNIX epoch time)."]
30111 pub time_unix_usec: u64,
30112 #[doc = "Timestamp (time since system boot)."]
30113 pub time_boot_ms: u32,
30114}
30115impl SYSTEM_TIME_DATA {
30116 pub const ENCODED_LEN: usize = 12usize;
30117 pub const DEFAULT: Self = Self {
30118 time_unix_usec: 0_u64,
30119 time_boot_ms: 0_u32,
30120 };
30121 #[cfg(feature = "arbitrary")]
30122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30123 use arbitrary::{Arbitrary, Unstructured};
30124 let mut buf = [0u8; 1024];
30125 rng.fill_bytes(&mut buf);
30126 let mut unstructured = Unstructured::new(&buf);
30127 Self::arbitrary(&mut unstructured).unwrap_or_default()
30128 }
30129}
30130impl Default for SYSTEM_TIME_DATA {
30131 fn default() -> Self {
30132 Self::DEFAULT.clone()
30133 }
30134}
30135impl MessageData for SYSTEM_TIME_DATA {
30136 type Message = MavMessage;
30137 const ID: u32 = 2u32;
30138 const NAME: &'static str = "SYSTEM_TIME";
30139 const EXTRA_CRC: u8 = 137u8;
30140 const ENCODED_LEN: usize = 12usize;
30141 fn deser(
30142 _version: MavlinkVersion,
30143 __input: &[u8],
30144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30145 let avail_len = __input.len();
30146 let mut payload_buf = [0; Self::ENCODED_LEN];
30147 let mut buf = if avail_len < Self::ENCODED_LEN {
30148 payload_buf[0..avail_len].copy_from_slice(__input);
30149 Bytes::new(&payload_buf)
30150 } else {
30151 Bytes::new(__input)
30152 };
30153 let mut __struct = Self::default();
30154 __struct.time_unix_usec = buf.get_u64_le();
30155 __struct.time_boot_ms = buf.get_u32_le();
30156 Ok(__struct)
30157 }
30158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30159 let mut __tmp = BytesMut::new(bytes);
30160 #[allow(clippy::absurd_extreme_comparisons)]
30161 #[allow(unused_comparisons)]
30162 if __tmp.remaining() < Self::ENCODED_LEN {
30163 panic!(
30164 "buffer is too small (need {} bytes, but got {})",
30165 Self::ENCODED_LEN,
30166 __tmp.remaining(),
30167 )
30168 }
30169 __tmp.put_u64_le(self.time_unix_usec);
30170 __tmp.put_u32_le(self.time_boot_ms);
30171 if matches!(version, MavlinkVersion::V2) {
30172 let len = __tmp.len();
30173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30174 } else {
30175 __tmp.len()
30176 }
30177 }
30178}
30179#[doc = "id: 1"]
30180#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
30181#[derive(Debug, Clone, PartialEq)]
30182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30184pub struct SYS_STATUS_DATA {
30185 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
30186 pub onboard_control_sensors_present: MavSysStatusSensor,
30187 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
30188 pub onboard_control_sensors_enabled: MavSysStatusSensor,
30189 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
30190 pub onboard_control_sensors_health: MavSysStatusSensor,
30191 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
30192 pub load: u16,
30193 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
30194 pub voltage_battery: u16,
30195 #[doc = "Battery current, -1: Current not sent by autopilot"]
30196 pub current_battery: i16,
30197 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
30198 pub drop_rate_comm: u16,
30199 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
30200 pub errors_comm: u16,
30201 #[doc = "Autopilot-specific errors"]
30202 pub errors_count1: u16,
30203 #[doc = "Autopilot-specific errors"]
30204 pub errors_count2: u16,
30205 #[doc = "Autopilot-specific errors"]
30206 pub errors_count3: u16,
30207 #[doc = "Autopilot-specific errors"]
30208 pub errors_count4: u16,
30209 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
30210 pub battery_remaining: i8,
30211 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
30212 #[cfg_attr(feature = "serde", serde(default))]
30213 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
30214 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
30215 #[cfg_attr(feature = "serde", serde(default))]
30216 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
30217 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
30218 #[cfg_attr(feature = "serde", serde(default))]
30219 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
30220}
30221impl SYS_STATUS_DATA {
30222 pub const ENCODED_LEN: usize = 43usize;
30223 pub const DEFAULT: Self = Self {
30224 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
30225 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
30226 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
30227 load: 0_u16,
30228 voltage_battery: 0_u16,
30229 current_battery: 0_i16,
30230 drop_rate_comm: 0_u16,
30231 errors_comm: 0_u16,
30232 errors_count1: 0_u16,
30233 errors_count2: 0_u16,
30234 errors_count3: 0_u16,
30235 errors_count4: 0_u16,
30236 battery_remaining: 0_i8,
30237 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
30238 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
30239 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
30240 };
30241 #[cfg(feature = "arbitrary")]
30242 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30243 use arbitrary::{Arbitrary, Unstructured};
30244 let mut buf = [0u8; 1024];
30245 rng.fill_bytes(&mut buf);
30246 let mut unstructured = Unstructured::new(&buf);
30247 Self::arbitrary(&mut unstructured).unwrap_or_default()
30248 }
30249}
30250impl Default for SYS_STATUS_DATA {
30251 fn default() -> Self {
30252 Self::DEFAULT.clone()
30253 }
30254}
30255impl MessageData for SYS_STATUS_DATA {
30256 type Message = MavMessage;
30257 const ID: u32 = 1u32;
30258 const NAME: &'static str = "SYS_STATUS";
30259 const EXTRA_CRC: u8 = 124u8;
30260 const ENCODED_LEN: usize = 43usize;
30261 fn deser(
30262 _version: MavlinkVersion,
30263 __input: &[u8],
30264 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30265 let avail_len = __input.len();
30266 let mut payload_buf = [0; Self::ENCODED_LEN];
30267 let mut buf = if avail_len < Self::ENCODED_LEN {
30268 payload_buf[0..avail_len].copy_from_slice(__input);
30269 Bytes::new(&payload_buf)
30270 } else {
30271 Bytes::new(__input)
30272 };
30273 let mut __struct = Self::default();
30274 let tmp = buf.get_u32_le();
30275 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
30276 tmp & MavSysStatusSensor::all().bits(),
30277 )
30278 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30279 flag_type: "MavSysStatusSensor",
30280 value: tmp as u32,
30281 })?;
30282 let tmp = buf.get_u32_le();
30283 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
30284 tmp & MavSysStatusSensor::all().bits(),
30285 )
30286 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30287 flag_type: "MavSysStatusSensor",
30288 value: tmp as u32,
30289 })?;
30290 let tmp = buf.get_u32_le();
30291 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
30292 tmp & MavSysStatusSensor::all().bits(),
30293 )
30294 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30295 flag_type: "MavSysStatusSensor",
30296 value: tmp as u32,
30297 })?;
30298 __struct.load = buf.get_u16_le();
30299 __struct.voltage_battery = buf.get_u16_le();
30300 __struct.current_battery = buf.get_i16_le();
30301 __struct.drop_rate_comm = buf.get_u16_le();
30302 __struct.errors_comm = buf.get_u16_le();
30303 __struct.errors_count1 = buf.get_u16_le();
30304 __struct.errors_count2 = buf.get_u16_le();
30305 __struct.errors_count3 = buf.get_u16_le();
30306 __struct.errors_count4 = buf.get_u16_le();
30307 __struct.battery_remaining = buf.get_i8();
30308 let tmp = buf.get_u32_le();
30309 __struct.onboard_control_sensors_present_extended =
30310 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
30311 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30312 flag_type: "MavSysStatusSensorExtended",
30313 value: tmp as u32,
30314 })?;
30315 let tmp = buf.get_u32_le();
30316 __struct.onboard_control_sensors_enabled_extended =
30317 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
30318 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30319 flag_type: "MavSysStatusSensorExtended",
30320 value: tmp as u32,
30321 })?;
30322 let tmp = buf.get_u32_le();
30323 __struct.onboard_control_sensors_health_extended =
30324 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
30325 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30326 flag_type: "MavSysStatusSensorExtended",
30327 value: tmp as u32,
30328 })?;
30329 Ok(__struct)
30330 }
30331 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30332 let mut __tmp = BytesMut::new(bytes);
30333 #[allow(clippy::absurd_extreme_comparisons)]
30334 #[allow(unused_comparisons)]
30335 if __tmp.remaining() < Self::ENCODED_LEN {
30336 panic!(
30337 "buffer is too small (need {} bytes, but got {})",
30338 Self::ENCODED_LEN,
30339 __tmp.remaining(),
30340 )
30341 }
30342 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
30343 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
30344 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
30345 __tmp.put_u16_le(self.load);
30346 __tmp.put_u16_le(self.voltage_battery);
30347 __tmp.put_i16_le(self.current_battery);
30348 __tmp.put_u16_le(self.drop_rate_comm);
30349 __tmp.put_u16_le(self.errors_comm);
30350 __tmp.put_u16_le(self.errors_count1);
30351 __tmp.put_u16_le(self.errors_count2);
30352 __tmp.put_u16_le(self.errors_count3);
30353 __tmp.put_u16_le(self.errors_count4);
30354 __tmp.put_i8(self.battery_remaining);
30355 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
30356 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
30357 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
30358 if matches!(version, MavlinkVersion::V2) {
30359 let len = __tmp.len();
30360 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30361 } else {
30362 __tmp.len()
30363 }
30364 }
30365}
30366#[doc = "id: 135"]
30367#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
30368#[derive(Debug, Clone, PartialEq)]
30369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30371pub struct TERRAIN_CHECK_DATA {
30372 #[doc = "Latitude"]
30373 pub lat: i32,
30374 #[doc = "Longitude"]
30375 pub lon: i32,
30376}
30377impl TERRAIN_CHECK_DATA {
30378 pub const ENCODED_LEN: usize = 8usize;
30379 pub const DEFAULT: Self = Self {
30380 lat: 0_i32,
30381 lon: 0_i32,
30382 };
30383 #[cfg(feature = "arbitrary")]
30384 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30385 use arbitrary::{Arbitrary, Unstructured};
30386 let mut buf = [0u8; 1024];
30387 rng.fill_bytes(&mut buf);
30388 let mut unstructured = Unstructured::new(&buf);
30389 Self::arbitrary(&mut unstructured).unwrap_or_default()
30390 }
30391}
30392impl Default for TERRAIN_CHECK_DATA {
30393 fn default() -> Self {
30394 Self::DEFAULT.clone()
30395 }
30396}
30397impl MessageData for TERRAIN_CHECK_DATA {
30398 type Message = MavMessage;
30399 const ID: u32 = 135u32;
30400 const NAME: &'static str = "TERRAIN_CHECK";
30401 const EXTRA_CRC: u8 = 203u8;
30402 const ENCODED_LEN: usize = 8usize;
30403 fn deser(
30404 _version: MavlinkVersion,
30405 __input: &[u8],
30406 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30407 let avail_len = __input.len();
30408 let mut payload_buf = [0; Self::ENCODED_LEN];
30409 let mut buf = if avail_len < Self::ENCODED_LEN {
30410 payload_buf[0..avail_len].copy_from_slice(__input);
30411 Bytes::new(&payload_buf)
30412 } else {
30413 Bytes::new(__input)
30414 };
30415 let mut __struct = Self::default();
30416 __struct.lat = buf.get_i32_le();
30417 __struct.lon = buf.get_i32_le();
30418 Ok(__struct)
30419 }
30420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30421 let mut __tmp = BytesMut::new(bytes);
30422 #[allow(clippy::absurd_extreme_comparisons)]
30423 #[allow(unused_comparisons)]
30424 if __tmp.remaining() < Self::ENCODED_LEN {
30425 panic!(
30426 "buffer is too small (need {} bytes, but got {})",
30427 Self::ENCODED_LEN,
30428 __tmp.remaining(),
30429 )
30430 }
30431 __tmp.put_i32_le(self.lat);
30432 __tmp.put_i32_le(self.lon);
30433 if matches!(version, MavlinkVersion::V2) {
30434 let len = __tmp.len();
30435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30436 } else {
30437 __tmp.len()
30438 }
30439 }
30440}
30441#[doc = "id: 134"]
30442#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30443#[derive(Debug, Clone, PartialEq)]
30444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30446pub struct TERRAIN_DATA_DATA {
30447 #[doc = "Latitude of SW corner of first grid"]
30448 pub lat: i32,
30449 #[doc = "Longitude of SW corner of first grid"]
30450 pub lon: i32,
30451 #[doc = "Grid spacing"]
30452 pub grid_spacing: u16,
30453 #[doc = "Terrain data MSL"]
30454 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30455 pub data: [i16; 16],
30456 #[doc = "bit within the terrain request mask"]
30457 pub gridbit: u8,
30458}
30459impl TERRAIN_DATA_DATA {
30460 pub const ENCODED_LEN: usize = 43usize;
30461 pub const DEFAULT: Self = Self {
30462 lat: 0_i32,
30463 lon: 0_i32,
30464 grid_spacing: 0_u16,
30465 data: [0_i16; 16usize],
30466 gridbit: 0_u8,
30467 };
30468 #[cfg(feature = "arbitrary")]
30469 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30470 use arbitrary::{Arbitrary, Unstructured};
30471 let mut buf = [0u8; 1024];
30472 rng.fill_bytes(&mut buf);
30473 let mut unstructured = Unstructured::new(&buf);
30474 Self::arbitrary(&mut unstructured).unwrap_or_default()
30475 }
30476}
30477impl Default for TERRAIN_DATA_DATA {
30478 fn default() -> Self {
30479 Self::DEFAULT.clone()
30480 }
30481}
30482impl MessageData for TERRAIN_DATA_DATA {
30483 type Message = MavMessage;
30484 const ID: u32 = 134u32;
30485 const NAME: &'static str = "TERRAIN_DATA";
30486 const EXTRA_CRC: u8 = 229u8;
30487 const ENCODED_LEN: usize = 43usize;
30488 fn deser(
30489 _version: MavlinkVersion,
30490 __input: &[u8],
30491 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30492 let avail_len = __input.len();
30493 let mut payload_buf = [0; Self::ENCODED_LEN];
30494 let mut buf = if avail_len < Self::ENCODED_LEN {
30495 payload_buf[0..avail_len].copy_from_slice(__input);
30496 Bytes::new(&payload_buf)
30497 } else {
30498 Bytes::new(__input)
30499 };
30500 let mut __struct = Self::default();
30501 __struct.lat = buf.get_i32_le();
30502 __struct.lon = buf.get_i32_le();
30503 __struct.grid_spacing = buf.get_u16_le();
30504 for v in &mut __struct.data {
30505 let val = buf.get_i16_le();
30506 *v = val;
30507 }
30508 __struct.gridbit = buf.get_u8();
30509 Ok(__struct)
30510 }
30511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30512 let mut __tmp = BytesMut::new(bytes);
30513 #[allow(clippy::absurd_extreme_comparisons)]
30514 #[allow(unused_comparisons)]
30515 if __tmp.remaining() < Self::ENCODED_LEN {
30516 panic!(
30517 "buffer is too small (need {} bytes, but got {})",
30518 Self::ENCODED_LEN,
30519 __tmp.remaining(),
30520 )
30521 }
30522 __tmp.put_i32_le(self.lat);
30523 __tmp.put_i32_le(self.lon);
30524 __tmp.put_u16_le(self.grid_spacing);
30525 for val in &self.data {
30526 __tmp.put_i16_le(*val);
30527 }
30528 __tmp.put_u8(self.gridbit);
30529 if matches!(version, MavlinkVersion::V2) {
30530 let len = __tmp.len();
30531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30532 } else {
30533 __tmp.len()
30534 }
30535 }
30536}
30537#[doc = "id: 136"]
30538#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30539#[derive(Debug, Clone, PartialEq)]
30540#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30542pub struct TERRAIN_REPORT_DATA {
30543 #[doc = "Latitude"]
30544 pub lat: i32,
30545 #[doc = "Longitude"]
30546 pub lon: i32,
30547 #[doc = "Terrain height MSL"]
30548 pub terrain_height: f32,
30549 #[doc = "Current vehicle height above lat/lon terrain height"]
30550 pub current_height: f32,
30551 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
30552 pub spacing: u16,
30553 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
30554 pub pending: u16,
30555 #[doc = "Number of 4x4 terrain blocks in memory"]
30556 pub loaded: u16,
30557}
30558impl TERRAIN_REPORT_DATA {
30559 pub const ENCODED_LEN: usize = 22usize;
30560 pub const DEFAULT: Self = Self {
30561 lat: 0_i32,
30562 lon: 0_i32,
30563 terrain_height: 0.0_f32,
30564 current_height: 0.0_f32,
30565 spacing: 0_u16,
30566 pending: 0_u16,
30567 loaded: 0_u16,
30568 };
30569 #[cfg(feature = "arbitrary")]
30570 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30571 use arbitrary::{Arbitrary, Unstructured};
30572 let mut buf = [0u8; 1024];
30573 rng.fill_bytes(&mut buf);
30574 let mut unstructured = Unstructured::new(&buf);
30575 Self::arbitrary(&mut unstructured).unwrap_or_default()
30576 }
30577}
30578impl Default for TERRAIN_REPORT_DATA {
30579 fn default() -> Self {
30580 Self::DEFAULT.clone()
30581 }
30582}
30583impl MessageData for TERRAIN_REPORT_DATA {
30584 type Message = MavMessage;
30585 const ID: u32 = 136u32;
30586 const NAME: &'static str = "TERRAIN_REPORT";
30587 const EXTRA_CRC: u8 = 1u8;
30588 const ENCODED_LEN: usize = 22usize;
30589 fn deser(
30590 _version: MavlinkVersion,
30591 __input: &[u8],
30592 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30593 let avail_len = __input.len();
30594 let mut payload_buf = [0; Self::ENCODED_LEN];
30595 let mut buf = if avail_len < Self::ENCODED_LEN {
30596 payload_buf[0..avail_len].copy_from_slice(__input);
30597 Bytes::new(&payload_buf)
30598 } else {
30599 Bytes::new(__input)
30600 };
30601 let mut __struct = Self::default();
30602 __struct.lat = buf.get_i32_le();
30603 __struct.lon = buf.get_i32_le();
30604 __struct.terrain_height = buf.get_f32_le();
30605 __struct.current_height = buf.get_f32_le();
30606 __struct.spacing = buf.get_u16_le();
30607 __struct.pending = buf.get_u16_le();
30608 __struct.loaded = buf.get_u16_le();
30609 Ok(__struct)
30610 }
30611 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30612 let mut __tmp = BytesMut::new(bytes);
30613 #[allow(clippy::absurd_extreme_comparisons)]
30614 #[allow(unused_comparisons)]
30615 if __tmp.remaining() < Self::ENCODED_LEN {
30616 panic!(
30617 "buffer is too small (need {} bytes, but got {})",
30618 Self::ENCODED_LEN,
30619 __tmp.remaining(),
30620 )
30621 }
30622 __tmp.put_i32_le(self.lat);
30623 __tmp.put_i32_le(self.lon);
30624 __tmp.put_f32_le(self.terrain_height);
30625 __tmp.put_f32_le(self.current_height);
30626 __tmp.put_u16_le(self.spacing);
30627 __tmp.put_u16_le(self.pending);
30628 __tmp.put_u16_le(self.loaded);
30629 if matches!(version, MavlinkVersion::V2) {
30630 let len = __tmp.len();
30631 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30632 } else {
30633 __tmp.len()
30634 }
30635 }
30636}
30637#[doc = "id: 133"]
30638#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30639#[derive(Debug, Clone, PartialEq)]
30640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30641#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30642pub struct TERRAIN_REQUEST_DATA {
30643 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
30644 pub mask: u64,
30645 #[doc = "Latitude of SW corner of first grid"]
30646 pub lat: i32,
30647 #[doc = "Longitude of SW corner of first grid"]
30648 pub lon: i32,
30649 #[doc = "Grid spacing"]
30650 pub grid_spacing: u16,
30651}
30652impl TERRAIN_REQUEST_DATA {
30653 pub const ENCODED_LEN: usize = 18usize;
30654 pub const DEFAULT: Self = Self {
30655 mask: 0_u64,
30656 lat: 0_i32,
30657 lon: 0_i32,
30658 grid_spacing: 0_u16,
30659 };
30660 #[cfg(feature = "arbitrary")]
30661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30662 use arbitrary::{Arbitrary, Unstructured};
30663 let mut buf = [0u8; 1024];
30664 rng.fill_bytes(&mut buf);
30665 let mut unstructured = Unstructured::new(&buf);
30666 Self::arbitrary(&mut unstructured).unwrap_or_default()
30667 }
30668}
30669impl Default for TERRAIN_REQUEST_DATA {
30670 fn default() -> Self {
30671 Self::DEFAULT.clone()
30672 }
30673}
30674impl MessageData for TERRAIN_REQUEST_DATA {
30675 type Message = MavMessage;
30676 const ID: u32 = 133u32;
30677 const NAME: &'static str = "TERRAIN_REQUEST";
30678 const EXTRA_CRC: u8 = 6u8;
30679 const ENCODED_LEN: usize = 18usize;
30680 fn deser(
30681 _version: MavlinkVersion,
30682 __input: &[u8],
30683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30684 let avail_len = __input.len();
30685 let mut payload_buf = [0; Self::ENCODED_LEN];
30686 let mut buf = if avail_len < Self::ENCODED_LEN {
30687 payload_buf[0..avail_len].copy_from_slice(__input);
30688 Bytes::new(&payload_buf)
30689 } else {
30690 Bytes::new(__input)
30691 };
30692 let mut __struct = Self::default();
30693 __struct.mask = buf.get_u64_le();
30694 __struct.lat = buf.get_i32_le();
30695 __struct.lon = buf.get_i32_le();
30696 __struct.grid_spacing = buf.get_u16_le();
30697 Ok(__struct)
30698 }
30699 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30700 let mut __tmp = BytesMut::new(bytes);
30701 #[allow(clippy::absurd_extreme_comparisons)]
30702 #[allow(unused_comparisons)]
30703 if __tmp.remaining() < Self::ENCODED_LEN {
30704 panic!(
30705 "buffer is too small (need {} bytes, but got {})",
30706 Self::ENCODED_LEN,
30707 __tmp.remaining(),
30708 )
30709 }
30710 __tmp.put_u64_le(self.mask);
30711 __tmp.put_i32_le(self.lat);
30712 __tmp.put_i32_le(self.lon);
30713 __tmp.put_u16_le(self.grid_spacing);
30714 if matches!(version, MavlinkVersion::V2) {
30715 let len = __tmp.len();
30716 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30717 } else {
30718 __tmp.len()
30719 }
30720 }
30721}
30722#[doc = "id: 111"]
30723#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
30724#[derive(Debug, Clone, PartialEq)]
30725#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30726#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30727pub struct TIMESYNC_DATA {
30728 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
30729 pub tc1: i64,
30730 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
30731 pub ts1: i64,
30732 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
30733 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30734 pub target_system: u8,
30735 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
30736 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30737 pub target_component: u8,
30738}
30739impl TIMESYNC_DATA {
30740 pub const ENCODED_LEN: usize = 18usize;
30741 pub const DEFAULT: Self = Self {
30742 tc1: 0_i64,
30743 ts1: 0_i64,
30744 target_system: 0_u8,
30745 target_component: 0_u8,
30746 };
30747 #[cfg(feature = "arbitrary")]
30748 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30749 use arbitrary::{Arbitrary, Unstructured};
30750 let mut buf = [0u8; 1024];
30751 rng.fill_bytes(&mut buf);
30752 let mut unstructured = Unstructured::new(&buf);
30753 Self::arbitrary(&mut unstructured).unwrap_or_default()
30754 }
30755}
30756impl Default for TIMESYNC_DATA {
30757 fn default() -> Self {
30758 Self::DEFAULT.clone()
30759 }
30760}
30761impl MessageData for TIMESYNC_DATA {
30762 type Message = MavMessage;
30763 const ID: u32 = 111u32;
30764 const NAME: &'static str = "TIMESYNC";
30765 const EXTRA_CRC: u8 = 34u8;
30766 const ENCODED_LEN: usize = 18usize;
30767 fn deser(
30768 _version: MavlinkVersion,
30769 __input: &[u8],
30770 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30771 let avail_len = __input.len();
30772 let mut payload_buf = [0; Self::ENCODED_LEN];
30773 let mut buf = if avail_len < Self::ENCODED_LEN {
30774 payload_buf[0..avail_len].copy_from_slice(__input);
30775 Bytes::new(&payload_buf)
30776 } else {
30777 Bytes::new(__input)
30778 };
30779 let mut __struct = Self::default();
30780 __struct.tc1 = buf.get_i64_le();
30781 __struct.ts1 = buf.get_i64_le();
30782 __struct.target_system = buf.get_u8();
30783 __struct.target_component = buf.get_u8();
30784 Ok(__struct)
30785 }
30786 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30787 let mut __tmp = BytesMut::new(bytes);
30788 #[allow(clippy::absurd_extreme_comparisons)]
30789 #[allow(unused_comparisons)]
30790 if __tmp.remaining() < Self::ENCODED_LEN {
30791 panic!(
30792 "buffer is too small (need {} bytes, but got {})",
30793 Self::ENCODED_LEN,
30794 __tmp.remaining(),
30795 )
30796 }
30797 __tmp.put_i64_le(self.tc1);
30798 __tmp.put_i64_le(self.ts1);
30799 __tmp.put_u8(self.target_system);
30800 __tmp.put_u8(self.target_component);
30801 if matches!(version, MavlinkVersion::V2) {
30802 let len = __tmp.len();
30803 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30804 } else {
30805 __tmp.len()
30806 }
30807 }
30808}
30809#[doc = "id: 380"]
30810#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30811#[derive(Debug, Clone, PartialEq)]
30812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30814pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30815 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30816 pub safe_return: i32,
30817 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30818 pub land: i32,
30819 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30820 pub mission_next_item: i32,
30821 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30822 pub mission_end: i32,
30823 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30824 pub commanded_action: i32,
30825}
30826impl TIME_ESTIMATE_TO_TARGET_DATA {
30827 pub const ENCODED_LEN: usize = 20usize;
30828 pub const DEFAULT: Self = Self {
30829 safe_return: 0_i32,
30830 land: 0_i32,
30831 mission_next_item: 0_i32,
30832 mission_end: 0_i32,
30833 commanded_action: 0_i32,
30834 };
30835 #[cfg(feature = "arbitrary")]
30836 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30837 use arbitrary::{Arbitrary, Unstructured};
30838 let mut buf = [0u8; 1024];
30839 rng.fill_bytes(&mut buf);
30840 let mut unstructured = Unstructured::new(&buf);
30841 Self::arbitrary(&mut unstructured).unwrap_or_default()
30842 }
30843}
30844impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30845 fn default() -> Self {
30846 Self::DEFAULT.clone()
30847 }
30848}
30849impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30850 type Message = MavMessage;
30851 const ID: u32 = 380u32;
30852 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30853 const EXTRA_CRC: u8 = 232u8;
30854 const ENCODED_LEN: usize = 20usize;
30855 fn deser(
30856 _version: MavlinkVersion,
30857 __input: &[u8],
30858 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30859 let avail_len = __input.len();
30860 let mut payload_buf = [0; Self::ENCODED_LEN];
30861 let mut buf = if avail_len < Self::ENCODED_LEN {
30862 payload_buf[0..avail_len].copy_from_slice(__input);
30863 Bytes::new(&payload_buf)
30864 } else {
30865 Bytes::new(__input)
30866 };
30867 let mut __struct = Self::default();
30868 __struct.safe_return = buf.get_i32_le();
30869 __struct.land = buf.get_i32_le();
30870 __struct.mission_next_item = buf.get_i32_le();
30871 __struct.mission_end = buf.get_i32_le();
30872 __struct.commanded_action = buf.get_i32_le();
30873 Ok(__struct)
30874 }
30875 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30876 let mut __tmp = BytesMut::new(bytes);
30877 #[allow(clippy::absurd_extreme_comparisons)]
30878 #[allow(unused_comparisons)]
30879 if __tmp.remaining() < Self::ENCODED_LEN {
30880 panic!(
30881 "buffer is too small (need {} bytes, but got {})",
30882 Self::ENCODED_LEN,
30883 __tmp.remaining(),
30884 )
30885 }
30886 __tmp.put_i32_le(self.safe_return);
30887 __tmp.put_i32_le(self.land);
30888 __tmp.put_i32_le(self.mission_next_item);
30889 __tmp.put_i32_le(self.mission_end);
30890 __tmp.put_i32_le(self.commanded_action);
30891 if matches!(version, MavlinkVersion::V2) {
30892 let len = __tmp.len();
30893 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30894 } else {
30895 __tmp.len()
30896 }
30897 }
30898}
30899#[doc = "id: 333"]
30900#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30901#[derive(Debug, Clone, PartialEq)]
30902#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30903#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30904pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30905 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30906 pub time_usec: u64,
30907 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30908 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30909 pub pos_x: [f32; 5],
30910 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30911 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30912 pub pos_y: [f32; 5],
30913 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30915 pub pos_z: [f32; 5],
30916 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30917 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30918 pub delta: [f32; 5],
30919 #[doc = "Yaw. Set to NaN for unchanged"]
30920 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30921 pub pos_yaw: [f32; 5],
30922 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30923 pub valid_points: u8,
30924}
30925impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30926 pub const ENCODED_LEN: usize = 109usize;
30927 pub const DEFAULT: Self = Self {
30928 time_usec: 0_u64,
30929 pos_x: [0.0_f32; 5usize],
30930 pos_y: [0.0_f32; 5usize],
30931 pos_z: [0.0_f32; 5usize],
30932 delta: [0.0_f32; 5usize],
30933 pos_yaw: [0.0_f32; 5usize],
30934 valid_points: 0_u8,
30935 };
30936 #[cfg(feature = "arbitrary")]
30937 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30938 use arbitrary::{Arbitrary, Unstructured};
30939 let mut buf = [0u8; 1024];
30940 rng.fill_bytes(&mut buf);
30941 let mut unstructured = Unstructured::new(&buf);
30942 Self::arbitrary(&mut unstructured).unwrap_or_default()
30943 }
30944}
30945impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30946 fn default() -> Self {
30947 Self::DEFAULT.clone()
30948 }
30949}
30950impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30951 type Message = MavMessage;
30952 const ID: u32 = 333u32;
30953 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30954 const EXTRA_CRC: u8 = 231u8;
30955 const ENCODED_LEN: usize = 109usize;
30956 fn deser(
30957 _version: MavlinkVersion,
30958 __input: &[u8],
30959 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30960 let avail_len = __input.len();
30961 let mut payload_buf = [0; Self::ENCODED_LEN];
30962 let mut buf = if avail_len < Self::ENCODED_LEN {
30963 payload_buf[0..avail_len].copy_from_slice(__input);
30964 Bytes::new(&payload_buf)
30965 } else {
30966 Bytes::new(__input)
30967 };
30968 let mut __struct = Self::default();
30969 __struct.time_usec = buf.get_u64_le();
30970 for v in &mut __struct.pos_x {
30971 let val = buf.get_f32_le();
30972 *v = val;
30973 }
30974 for v in &mut __struct.pos_y {
30975 let val = buf.get_f32_le();
30976 *v = val;
30977 }
30978 for v in &mut __struct.pos_z {
30979 let val = buf.get_f32_le();
30980 *v = val;
30981 }
30982 for v in &mut __struct.delta {
30983 let val = buf.get_f32_le();
30984 *v = val;
30985 }
30986 for v in &mut __struct.pos_yaw {
30987 let val = buf.get_f32_le();
30988 *v = val;
30989 }
30990 __struct.valid_points = buf.get_u8();
30991 Ok(__struct)
30992 }
30993 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30994 let mut __tmp = BytesMut::new(bytes);
30995 #[allow(clippy::absurd_extreme_comparisons)]
30996 #[allow(unused_comparisons)]
30997 if __tmp.remaining() < Self::ENCODED_LEN {
30998 panic!(
30999 "buffer is too small (need {} bytes, but got {})",
31000 Self::ENCODED_LEN,
31001 __tmp.remaining(),
31002 )
31003 }
31004 __tmp.put_u64_le(self.time_usec);
31005 for val in &self.pos_x {
31006 __tmp.put_f32_le(*val);
31007 }
31008 for val in &self.pos_y {
31009 __tmp.put_f32_le(*val);
31010 }
31011 for val in &self.pos_z {
31012 __tmp.put_f32_le(*val);
31013 }
31014 for val in &self.delta {
31015 __tmp.put_f32_le(*val);
31016 }
31017 for val in &self.pos_yaw {
31018 __tmp.put_f32_le(*val);
31019 }
31020 __tmp.put_u8(self.valid_points);
31021 if matches!(version, MavlinkVersion::V2) {
31022 let len = __tmp.len();
31023 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31024 } else {
31025 __tmp.len()
31026 }
31027 }
31028}
31029#[doc = "id: 332"]
31030#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
31031#[derive(Debug, Clone, PartialEq)]
31032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31034pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
31035 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31036 pub time_usec: u64,
31037 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
31038 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31039 pub pos_x: [f32; 5],
31040 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
31041 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31042 pub pos_y: [f32; 5],
31043 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
31044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31045 pub pos_z: [f32; 5],
31046 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
31047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31048 pub vel_x: [f32; 5],
31049 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
31050 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31051 pub vel_y: [f32; 5],
31052 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
31053 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31054 pub vel_z: [f32; 5],
31055 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
31056 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31057 pub acc_x: [f32; 5],
31058 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
31059 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31060 pub acc_y: [f32; 5],
31061 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
31062 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31063 pub acc_z: [f32; 5],
31064 #[doc = "Yaw angle, set to NaN if not being used"]
31065 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31066 pub pos_yaw: [f32; 5],
31067 #[doc = "Yaw rate, set to NaN if not being used"]
31068 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31069 pub vel_yaw: [f32; 5],
31070 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
31071 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31072 pub command: [u16; 5],
31073 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
31074 pub valid_points: u8,
31075}
31076impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
31077 pub const ENCODED_LEN: usize = 239usize;
31078 pub const DEFAULT: Self = Self {
31079 time_usec: 0_u64,
31080 pos_x: [0.0_f32; 5usize],
31081 pos_y: [0.0_f32; 5usize],
31082 pos_z: [0.0_f32; 5usize],
31083 vel_x: [0.0_f32; 5usize],
31084 vel_y: [0.0_f32; 5usize],
31085 vel_z: [0.0_f32; 5usize],
31086 acc_x: [0.0_f32; 5usize],
31087 acc_y: [0.0_f32; 5usize],
31088 acc_z: [0.0_f32; 5usize],
31089 pos_yaw: [0.0_f32; 5usize],
31090 vel_yaw: [0.0_f32; 5usize],
31091 command: [0_u16; 5usize],
31092 valid_points: 0_u8,
31093 };
31094 #[cfg(feature = "arbitrary")]
31095 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31096 use arbitrary::{Arbitrary, Unstructured};
31097 let mut buf = [0u8; 1024];
31098 rng.fill_bytes(&mut buf);
31099 let mut unstructured = Unstructured::new(&buf);
31100 Self::arbitrary(&mut unstructured).unwrap_or_default()
31101 }
31102}
31103impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
31104 fn default() -> Self {
31105 Self::DEFAULT.clone()
31106 }
31107}
31108impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
31109 type Message = MavMessage;
31110 const ID: u32 = 332u32;
31111 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
31112 const EXTRA_CRC: u8 = 236u8;
31113 const ENCODED_LEN: usize = 239usize;
31114 fn deser(
31115 _version: MavlinkVersion,
31116 __input: &[u8],
31117 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31118 let avail_len = __input.len();
31119 let mut payload_buf = [0; Self::ENCODED_LEN];
31120 let mut buf = if avail_len < Self::ENCODED_LEN {
31121 payload_buf[0..avail_len].copy_from_slice(__input);
31122 Bytes::new(&payload_buf)
31123 } else {
31124 Bytes::new(__input)
31125 };
31126 let mut __struct = Self::default();
31127 __struct.time_usec = buf.get_u64_le();
31128 for v in &mut __struct.pos_x {
31129 let val = buf.get_f32_le();
31130 *v = val;
31131 }
31132 for v in &mut __struct.pos_y {
31133 let val = buf.get_f32_le();
31134 *v = val;
31135 }
31136 for v in &mut __struct.pos_z {
31137 let val = buf.get_f32_le();
31138 *v = val;
31139 }
31140 for v in &mut __struct.vel_x {
31141 let val = buf.get_f32_le();
31142 *v = val;
31143 }
31144 for v in &mut __struct.vel_y {
31145 let val = buf.get_f32_le();
31146 *v = val;
31147 }
31148 for v in &mut __struct.vel_z {
31149 let val = buf.get_f32_le();
31150 *v = val;
31151 }
31152 for v in &mut __struct.acc_x {
31153 let val = buf.get_f32_le();
31154 *v = val;
31155 }
31156 for v in &mut __struct.acc_y {
31157 let val = buf.get_f32_le();
31158 *v = val;
31159 }
31160 for v in &mut __struct.acc_z {
31161 let val = buf.get_f32_le();
31162 *v = val;
31163 }
31164 for v in &mut __struct.pos_yaw {
31165 let val = buf.get_f32_le();
31166 *v = val;
31167 }
31168 for v in &mut __struct.vel_yaw {
31169 let val = buf.get_f32_le();
31170 *v = val;
31171 }
31172 for v in &mut __struct.command {
31173 let val = buf.get_u16_le();
31174 *v = val;
31175 }
31176 __struct.valid_points = buf.get_u8();
31177 Ok(__struct)
31178 }
31179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31180 let mut __tmp = BytesMut::new(bytes);
31181 #[allow(clippy::absurd_extreme_comparisons)]
31182 #[allow(unused_comparisons)]
31183 if __tmp.remaining() < Self::ENCODED_LEN {
31184 panic!(
31185 "buffer is too small (need {} bytes, but got {})",
31186 Self::ENCODED_LEN,
31187 __tmp.remaining(),
31188 )
31189 }
31190 __tmp.put_u64_le(self.time_usec);
31191 for val in &self.pos_x {
31192 __tmp.put_f32_le(*val);
31193 }
31194 for val in &self.pos_y {
31195 __tmp.put_f32_le(*val);
31196 }
31197 for val in &self.pos_z {
31198 __tmp.put_f32_le(*val);
31199 }
31200 for val in &self.vel_x {
31201 __tmp.put_f32_le(*val);
31202 }
31203 for val in &self.vel_y {
31204 __tmp.put_f32_le(*val);
31205 }
31206 for val in &self.vel_z {
31207 __tmp.put_f32_le(*val);
31208 }
31209 for val in &self.acc_x {
31210 __tmp.put_f32_le(*val);
31211 }
31212 for val in &self.acc_y {
31213 __tmp.put_f32_le(*val);
31214 }
31215 for val in &self.acc_z {
31216 __tmp.put_f32_le(*val);
31217 }
31218 for val in &self.pos_yaw {
31219 __tmp.put_f32_le(*val);
31220 }
31221 for val in &self.vel_yaw {
31222 __tmp.put_f32_le(*val);
31223 }
31224 for val in &self.command {
31225 __tmp.put_u16_le(*val);
31226 }
31227 __tmp.put_u8(self.valid_points);
31228 if matches!(version, MavlinkVersion::V2) {
31229 let len = __tmp.len();
31230 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31231 } else {
31232 __tmp.len()
31233 }
31234 }
31235}
31236#[doc = "id: 385"]
31237#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
31238#[derive(Debug, Clone, PartialEq)]
31239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31241pub struct TUNNEL_DATA {
31242 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31243 pub payload_type: MavTunnelPayloadType,
31244 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
31245 pub target_system: u8,
31246 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
31247 pub target_component: u8,
31248 #[doc = "Length of the data transported in payload"]
31249 pub payload_length: u8,
31250 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
31251 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31252 pub payload: [u8; 128],
31253}
31254impl TUNNEL_DATA {
31255 pub const ENCODED_LEN: usize = 133usize;
31256 pub const DEFAULT: Self = Self {
31257 payload_type: MavTunnelPayloadType::DEFAULT,
31258 target_system: 0_u8,
31259 target_component: 0_u8,
31260 payload_length: 0_u8,
31261 payload: [0_u8; 128usize],
31262 };
31263 #[cfg(feature = "arbitrary")]
31264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31265 use arbitrary::{Arbitrary, Unstructured};
31266 let mut buf = [0u8; 1024];
31267 rng.fill_bytes(&mut buf);
31268 let mut unstructured = Unstructured::new(&buf);
31269 Self::arbitrary(&mut unstructured).unwrap_or_default()
31270 }
31271}
31272impl Default for TUNNEL_DATA {
31273 fn default() -> Self {
31274 Self::DEFAULT.clone()
31275 }
31276}
31277impl MessageData for TUNNEL_DATA {
31278 type Message = MavMessage;
31279 const ID: u32 = 385u32;
31280 const NAME: &'static str = "TUNNEL";
31281 const EXTRA_CRC: u8 = 147u8;
31282 const ENCODED_LEN: usize = 133usize;
31283 fn deser(
31284 _version: MavlinkVersion,
31285 __input: &[u8],
31286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31287 let avail_len = __input.len();
31288 let mut payload_buf = [0; Self::ENCODED_LEN];
31289 let mut buf = if avail_len < Self::ENCODED_LEN {
31290 payload_buf[0..avail_len].copy_from_slice(__input);
31291 Bytes::new(&payload_buf)
31292 } else {
31293 Bytes::new(__input)
31294 };
31295 let mut __struct = Self::default();
31296 let tmp = buf.get_u16_le();
31297 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
31298 ::mavlink_core::error::ParserError::InvalidEnum {
31299 enum_type: "MavTunnelPayloadType",
31300 value: tmp as u32,
31301 },
31302 )?;
31303 __struct.target_system = buf.get_u8();
31304 __struct.target_component = buf.get_u8();
31305 __struct.payload_length = buf.get_u8();
31306 for v in &mut __struct.payload {
31307 let val = buf.get_u8();
31308 *v = val;
31309 }
31310 Ok(__struct)
31311 }
31312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31313 let mut __tmp = BytesMut::new(bytes);
31314 #[allow(clippy::absurd_extreme_comparisons)]
31315 #[allow(unused_comparisons)]
31316 if __tmp.remaining() < Self::ENCODED_LEN {
31317 panic!(
31318 "buffer is too small (need {} bytes, but got {})",
31319 Self::ENCODED_LEN,
31320 __tmp.remaining(),
31321 )
31322 }
31323 __tmp.put_u16_le(self.payload_type as u16);
31324 __tmp.put_u8(self.target_system);
31325 __tmp.put_u8(self.target_component);
31326 __tmp.put_u8(self.payload_length);
31327 for val in &self.payload {
31328 __tmp.put_u8(*val);
31329 }
31330 if matches!(version, MavlinkVersion::V2) {
31331 let len = __tmp.len();
31332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31333 } else {
31334 __tmp.len()
31335 }
31336 }
31337}
31338#[doc = "id: 311"]
31339#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
31340#[derive(Debug, Clone, PartialEq)]
31341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31343pub struct UAVCAN_NODE_INFO_DATA {
31344 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31345 pub time_usec: u64,
31346 #[doc = "Time since the start-up of the node."]
31347 pub uptime_sec: u32,
31348 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
31349 pub sw_vcs_commit: u32,
31350 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
31351 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31352 pub name: [u8; 80],
31353 #[doc = "Hardware major version number."]
31354 pub hw_version_major: u8,
31355 #[doc = "Hardware minor version number."]
31356 pub hw_version_minor: u8,
31357 #[doc = "Hardware unique 128-bit ID."]
31358 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31359 pub hw_unique_id: [u8; 16],
31360 #[doc = "Software major version number."]
31361 pub sw_version_major: u8,
31362 #[doc = "Software minor version number."]
31363 pub sw_version_minor: u8,
31364}
31365impl UAVCAN_NODE_INFO_DATA {
31366 pub const ENCODED_LEN: usize = 116usize;
31367 pub const DEFAULT: Self = Self {
31368 time_usec: 0_u64,
31369 uptime_sec: 0_u32,
31370 sw_vcs_commit: 0_u32,
31371 name: [0_u8; 80usize],
31372 hw_version_major: 0_u8,
31373 hw_version_minor: 0_u8,
31374 hw_unique_id: [0_u8; 16usize],
31375 sw_version_major: 0_u8,
31376 sw_version_minor: 0_u8,
31377 };
31378 #[cfg(feature = "arbitrary")]
31379 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31380 use arbitrary::{Arbitrary, Unstructured};
31381 let mut buf = [0u8; 1024];
31382 rng.fill_bytes(&mut buf);
31383 let mut unstructured = Unstructured::new(&buf);
31384 Self::arbitrary(&mut unstructured).unwrap_or_default()
31385 }
31386}
31387impl Default for UAVCAN_NODE_INFO_DATA {
31388 fn default() -> Self {
31389 Self::DEFAULT.clone()
31390 }
31391}
31392impl MessageData for UAVCAN_NODE_INFO_DATA {
31393 type Message = MavMessage;
31394 const ID: u32 = 311u32;
31395 const NAME: &'static str = "UAVCAN_NODE_INFO";
31396 const EXTRA_CRC: u8 = 95u8;
31397 const ENCODED_LEN: usize = 116usize;
31398 fn deser(
31399 _version: MavlinkVersion,
31400 __input: &[u8],
31401 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31402 let avail_len = __input.len();
31403 let mut payload_buf = [0; Self::ENCODED_LEN];
31404 let mut buf = if avail_len < Self::ENCODED_LEN {
31405 payload_buf[0..avail_len].copy_from_slice(__input);
31406 Bytes::new(&payload_buf)
31407 } else {
31408 Bytes::new(__input)
31409 };
31410 let mut __struct = Self::default();
31411 __struct.time_usec = buf.get_u64_le();
31412 __struct.uptime_sec = buf.get_u32_le();
31413 __struct.sw_vcs_commit = buf.get_u32_le();
31414 for v in &mut __struct.name {
31415 let val = buf.get_u8();
31416 *v = val;
31417 }
31418 __struct.hw_version_major = buf.get_u8();
31419 __struct.hw_version_minor = buf.get_u8();
31420 for v in &mut __struct.hw_unique_id {
31421 let val = buf.get_u8();
31422 *v = val;
31423 }
31424 __struct.sw_version_major = buf.get_u8();
31425 __struct.sw_version_minor = buf.get_u8();
31426 Ok(__struct)
31427 }
31428 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31429 let mut __tmp = BytesMut::new(bytes);
31430 #[allow(clippy::absurd_extreme_comparisons)]
31431 #[allow(unused_comparisons)]
31432 if __tmp.remaining() < Self::ENCODED_LEN {
31433 panic!(
31434 "buffer is too small (need {} bytes, but got {})",
31435 Self::ENCODED_LEN,
31436 __tmp.remaining(),
31437 )
31438 }
31439 __tmp.put_u64_le(self.time_usec);
31440 __tmp.put_u32_le(self.uptime_sec);
31441 __tmp.put_u32_le(self.sw_vcs_commit);
31442 for val in &self.name {
31443 __tmp.put_u8(*val);
31444 }
31445 __tmp.put_u8(self.hw_version_major);
31446 __tmp.put_u8(self.hw_version_minor);
31447 for val in &self.hw_unique_id {
31448 __tmp.put_u8(*val);
31449 }
31450 __tmp.put_u8(self.sw_version_major);
31451 __tmp.put_u8(self.sw_version_minor);
31452 if matches!(version, MavlinkVersion::V2) {
31453 let len = __tmp.len();
31454 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31455 } else {
31456 __tmp.len()
31457 }
31458 }
31459}
31460#[doc = "id: 310"]
31461#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
31462#[derive(Debug, Clone, PartialEq)]
31463#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31464#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31465pub struct UAVCAN_NODE_STATUS_DATA {
31466 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31467 pub time_usec: u64,
31468 #[doc = "Time since the start-up of the node."]
31469 pub uptime_sec: u32,
31470 #[doc = "Vendor-specific status information."]
31471 pub vendor_specific_status_code: u16,
31472 #[doc = "Generalized node health status."]
31473 pub health: UavcanNodeHealth,
31474 #[doc = "Generalized operating mode."]
31475 pub mode: UavcanNodeMode,
31476 #[doc = "Not used currently."]
31477 pub sub_mode: u8,
31478}
31479impl UAVCAN_NODE_STATUS_DATA {
31480 pub const ENCODED_LEN: usize = 17usize;
31481 pub const DEFAULT: Self = Self {
31482 time_usec: 0_u64,
31483 uptime_sec: 0_u32,
31484 vendor_specific_status_code: 0_u16,
31485 health: UavcanNodeHealth::DEFAULT,
31486 mode: UavcanNodeMode::DEFAULT,
31487 sub_mode: 0_u8,
31488 };
31489 #[cfg(feature = "arbitrary")]
31490 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31491 use arbitrary::{Arbitrary, Unstructured};
31492 let mut buf = [0u8; 1024];
31493 rng.fill_bytes(&mut buf);
31494 let mut unstructured = Unstructured::new(&buf);
31495 Self::arbitrary(&mut unstructured).unwrap_or_default()
31496 }
31497}
31498impl Default for UAVCAN_NODE_STATUS_DATA {
31499 fn default() -> Self {
31500 Self::DEFAULT.clone()
31501 }
31502}
31503impl MessageData for UAVCAN_NODE_STATUS_DATA {
31504 type Message = MavMessage;
31505 const ID: u32 = 310u32;
31506 const NAME: &'static str = "UAVCAN_NODE_STATUS";
31507 const EXTRA_CRC: u8 = 28u8;
31508 const ENCODED_LEN: usize = 17usize;
31509 fn deser(
31510 _version: MavlinkVersion,
31511 __input: &[u8],
31512 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31513 let avail_len = __input.len();
31514 let mut payload_buf = [0; Self::ENCODED_LEN];
31515 let mut buf = if avail_len < Self::ENCODED_LEN {
31516 payload_buf[0..avail_len].copy_from_slice(__input);
31517 Bytes::new(&payload_buf)
31518 } else {
31519 Bytes::new(__input)
31520 };
31521 let mut __struct = Self::default();
31522 __struct.time_usec = buf.get_u64_le();
31523 __struct.uptime_sec = buf.get_u32_le();
31524 __struct.vendor_specific_status_code = buf.get_u16_le();
31525 let tmp = buf.get_u8();
31526 __struct.health =
31527 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31528 enum_type: "UavcanNodeHealth",
31529 value: tmp as u32,
31530 })?;
31531 let tmp = buf.get_u8();
31532 __struct.mode =
31533 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31534 enum_type: "UavcanNodeMode",
31535 value: tmp as u32,
31536 })?;
31537 __struct.sub_mode = buf.get_u8();
31538 Ok(__struct)
31539 }
31540 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31541 let mut __tmp = BytesMut::new(bytes);
31542 #[allow(clippy::absurd_extreme_comparisons)]
31543 #[allow(unused_comparisons)]
31544 if __tmp.remaining() < Self::ENCODED_LEN {
31545 panic!(
31546 "buffer is too small (need {} bytes, but got {})",
31547 Self::ENCODED_LEN,
31548 __tmp.remaining(),
31549 )
31550 }
31551 __tmp.put_u64_le(self.time_usec);
31552 __tmp.put_u32_le(self.uptime_sec);
31553 __tmp.put_u16_le(self.vendor_specific_status_code);
31554 __tmp.put_u8(self.health as u8);
31555 __tmp.put_u8(self.mode as u8);
31556 __tmp.put_u8(self.sub_mode);
31557 if matches!(version, MavlinkVersion::V2) {
31558 let len = __tmp.len();
31559 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31560 } else {
31561 __tmp.len()
31562 }
31563 }
31564}
31565#[doc = "id: 340"]
31566#[doc = "The global position resulting from GPS and sensor fusion."]
31567#[derive(Debug, Clone, PartialEq)]
31568#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31570pub struct UTM_GLOBAL_POSITION_DATA {
31571 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
31572 pub time: u64,
31573 #[doc = "Latitude (WGS84)"]
31574 pub lat: i32,
31575 #[doc = "Longitude (WGS84)"]
31576 pub lon: i32,
31577 #[doc = "Altitude (WGS84)"]
31578 pub alt: i32,
31579 #[doc = "Altitude above ground"]
31580 pub relative_alt: i32,
31581 #[doc = "Next waypoint, latitude (WGS84)"]
31582 pub next_lat: i32,
31583 #[doc = "Next waypoint, longitude (WGS84)"]
31584 pub next_lon: i32,
31585 #[doc = "Next waypoint, altitude (WGS84)"]
31586 pub next_alt: i32,
31587 #[doc = "Ground X speed (latitude, positive north)"]
31588 pub vx: i16,
31589 #[doc = "Ground Y speed (longitude, positive east)"]
31590 pub vy: i16,
31591 #[doc = "Ground Z speed (altitude, positive down)"]
31592 pub vz: i16,
31593 #[doc = "Horizontal position uncertainty (standard deviation)"]
31594 pub h_acc: u16,
31595 #[doc = "Altitude uncertainty (standard deviation)"]
31596 pub v_acc: u16,
31597 #[doc = "Speed uncertainty (standard deviation)"]
31598 pub vel_acc: u16,
31599 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
31600 pub update_rate: u16,
31601 #[doc = "Unique UAS ID."]
31602 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31603 pub uas_id: [u8; 18],
31604 #[doc = "Flight state"]
31605 pub flight_state: UtmFlightState,
31606 #[doc = "Bitwise OR combination of the data available flags."]
31607 pub flags: UtmDataAvailFlags,
31608}
31609impl UTM_GLOBAL_POSITION_DATA {
31610 pub const ENCODED_LEN: usize = 70usize;
31611 pub const DEFAULT: Self = Self {
31612 time: 0_u64,
31613 lat: 0_i32,
31614 lon: 0_i32,
31615 alt: 0_i32,
31616 relative_alt: 0_i32,
31617 next_lat: 0_i32,
31618 next_lon: 0_i32,
31619 next_alt: 0_i32,
31620 vx: 0_i16,
31621 vy: 0_i16,
31622 vz: 0_i16,
31623 h_acc: 0_u16,
31624 v_acc: 0_u16,
31625 vel_acc: 0_u16,
31626 update_rate: 0_u16,
31627 uas_id: [0_u8; 18usize],
31628 flight_state: UtmFlightState::DEFAULT,
31629 flags: UtmDataAvailFlags::DEFAULT,
31630 };
31631 #[cfg(feature = "arbitrary")]
31632 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31633 use arbitrary::{Arbitrary, Unstructured};
31634 let mut buf = [0u8; 1024];
31635 rng.fill_bytes(&mut buf);
31636 let mut unstructured = Unstructured::new(&buf);
31637 Self::arbitrary(&mut unstructured).unwrap_or_default()
31638 }
31639}
31640impl Default for UTM_GLOBAL_POSITION_DATA {
31641 fn default() -> Self {
31642 Self::DEFAULT.clone()
31643 }
31644}
31645impl MessageData for UTM_GLOBAL_POSITION_DATA {
31646 type Message = MavMessage;
31647 const ID: u32 = 340u32;
31648 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31649 const EXTRA_CRC: u8 = 99u8;
31650 const ENCODED_LEN: usize = 70usize;
31651 fn deser(
31652 _version: MavlinkVersion,
31653 __input: &[u8],
31654 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31655 let avail_len = __input.len();
31656 let mut payload_buf = [0; Self::ENCODED_LEN];
31657 let mut buf = if avail_len < Self::ENCODED_LEN {
31658 payload_buf[0..avail_len].copy_from_slice(__input);
31659 Bytes::new(&payload_buf)
31660 } else {
31661 Bytes::new(__input)
31662 };
31663 let mut __struct = Self::default();
31664 __struct.time = buf.get_u64_le();
31665 __struct.lat = buf.get_i32_le();
31666 __struct.lon = buf.get_i32_le();
31667 __struct.alt = buf.get_i32_le();
31668 __struct.relative_alt = buf.get_i32_le();
31669 __struct.next_lat = buf.get_i32_le();
31670 __struct.next_lon = buf.get_i32_le();
31671 __struct.next_alt = buf.get_i32_le();
31672 __struct.vx = buf.get_i16_le();
31673 __struct.vy = buf.get_i16_le();
31674 __struct.vz = buf.get_i16_le();
31675 __struct.h_acc = buf.get_u16_le();
31676 __struct.v_acc = buf.get_u16_le();
31677 __struct.vel_acc = buf.get_u16_le();
31678 __struct.update_rate = buf.get_u16_le();
31679 for v in &mut __struct.uas_id {
31680 let val = buf.get_u8();
31681 *v = val;
31682 }
31683 let tmp = buf.get_u8();
31684 __struct.flight_state =
31685 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31686 enum_type: "UtmFlightState",
31687 value: tmp as u32,
31688 })?;
31689 let tmp = buf.get_u8();
31690 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
31691 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31692 flag_type: "UtmDataAvailFlags",
31693 value: tmp as u32,
31694 })?;
31695 Ok(__struct)
31696 }
31697 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31698 let mut __tmp = BytesMut::new(bytes);
31699 #[allow(clippy::absurd_extreme_comparisons)]
31700 #[allow(unused_comparisons)]
31701 if __tmp.remaining() < Self::ENCODED_LEN {
31702 panic!(
31703 "buffer is too small (need {} bytes, but got {})",
31704 Self::ENCODED_LEN,
31705 __tmp.remaining(),
31706 )
31707 }
31708 __tmp.put_u64_le(self.time);
31709 __tmp.put_i32_le(self.lat);
31710 __tmp.put_i32_le(self.lon);
31711 __tmp.put_i32_le(self.alt);
31712 __tmp.put_i32_le(self.relative_alt);
31713 __tmp.put_i32_le(self.next_lat);
31714 __tmp.put_i32_le(self.next_lon);
31715 __tmp.put_i32_le(self.next_alt);
31716 __tmp.put_i16_le(self.vx);
31717 __tmp.put_i16_le(self.vy);
31718 __tmp.put_i16_le(self.vz);
31719 __tmp.put_u16_le(self.h_acc);
31720 __tmp.put_u16_le(self.v_acc);
31721 __tmp.put_u16_le(self.vel_acc);
31722 __tmp.put_u16_le(self.update_rate);
31723 for val in &self.uas_id {
31724 __tmp.put_u8(*val);
31725 }
31726 __tmp.put_u8(self.flight_state as u8);
31727 __tmp.put_u8(self.flags.bits());
31728 if matches!(version, MavlinkVersion::V2) {
31729 let len = __tmp.len();
31730 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31731 } else {
31732 __tmp.len()
31733 }
31734 }
31735}
31736#[doc = "id: 248"]
31737#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31738#[derive(Debug, Clone, PartialEq)]
31739#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31741pub struct V2_EXTENSION_DATA {
31742 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31743 pub message_type: u16,
31744 #[doc = "Network ID (0 for broadcast)"]
31745 pub target_network: u8,
31746 #[doc = "System ID (0 for broadcast)"]
31747 pub target_system: u8,
31748 #[doc = "Component ID (0 for broadcast)"]
31749 pub target_component: u8,
31750 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31751 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31752 pub payload: [u8; 249],
31753}
31754impl V2_EXTENSION_DATA {
31755 pub const ENCODED_LEN: usize = 254usize;
31756 pub const DEFAULT: Self = Self {
31757 message_type: 0_u16,
31758 target_network: 0_u8,
31759 target_system: 0_u8,
31760 target_component: 0_u8,
31761 payload: [0_u8; 249usize],
31762 };
31763 #[cfg(feature = "arbitrary")]
31764 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31765 use arbitrary::{Arbitrary, Unstructured};
31766 let mut buf = [0u8; 1024];
31767 rng.fill_bytes(&mut buf);
31768 let mut unstructured = Unstructured::new(&buf);
31769 Self::arbitrary(&mut unstructured).unwrap_or_default()
31770 }
31771}
31772impl Default for V2_EXTENSION_DATA {
31773 fn default() -> Self {
31774 Self::DEFAULT.clone()
31775 }
31776}
31777impl MessageData for V2_EXTENSION_DATA {
31778 type Message = MavMessage;
31779 const ID: u32 = 248u32;
31780 const NAME: &'static str = "V2_EXTENSION";
31781 const EXTRA_CRC: u8 = 8u8;
31782 const ENCODED_LEN: usize = 254usize;
31783 fn deser(
31784 _version: MavlinkVersion,
31785 __input: &[u8],
31786 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31787 let avail_len = __input.len();
31788 let mut payload_buf = [0; Self::ENCODED_LEN];
31789 let mut buf = if avail_len < Self::ENCODED_LEN {
31790 payload_buf[0..avail_len].copy_from_slice(__input);
31791 Bytes::new(&payload_buf)
31792 } else {
31793 Bytes::new(__input)
31794 };
31795 let mut __struct = Self::default();
31796 __struct.message_type = buf.get_u16_le();
31797 __struct.target_network = buf.get_u8();
31798 __struct.target_system = buf.get_u8();
31799 __struct.target_component = buf.get_u8();
31800 for v in &mut __struct.payload {
31801 let val = buf.get_u8();
31802 *v = val;
31803 }
31804 Ok(__struct)
31805 }
31806 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31807 let mut __tmp = BytesMut::new(bytes);
31808 #[allow(clippy::absurd_extreme_comparisons)]
31809 #[allow(unused_comparisons)]
31810 if __tmp.remaining() < Self::ENCODED_LEN {
31811 panic!(
31812 "buffer is too small (need {} bytes, but got {})",
31813 Self::ENCODED_LEN,
31814 __tmp.remaining(),
31815 )
31816 }
31817 __tmp.put_u16_le(self.message_type);
31818 __tmp.put_u8(self.target_network);
31819 __tmp.put_u8(self.target_system);
31820 __tmp.put_u8(self.target_component);
31821 for val in &self.payload {
31822 __tmp.put_u8(*val);
31823 }
31824 if matches!(version, MavlinkVersion::V2) {
31825 let len = __tmp.len();
31826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31827 } else {
31828 __tmp.len()
31829 }
31830 }
31831}
31832#[doc = "id: 74"]
31833#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31834#[derive(Debug, Clone, PartialEq)]
31835#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31837pub struct VFR_HUD_DATA {
31838 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31839 pub airspeed: f32,
31840 #[doc = "Current ground speed."]
31841 pub groundspeed: f32,
31842 #[doc = "Current altitude (MSL)."]
31843 pub alt: f32,
31844 #[doc = "Current climb rate."]
31845 pub climb: f32,
31846 #[doc = "Current heading in compass units (0-360, 0=north)."]
31847 pub heading: i16,
31848 #[doc = "Current throttle setting (0 to 100)."]
31849 pub throttle: u16,
31850}
31851impl VFR_HUD_DATA {
31852 pub const ENCODED_LEN: usize = 20usize;
31853 pub const DEFAULT: Self = Self {
31854 airspeed: 0.0_f32,
31855 groundspeed: 0.0_f32,
31856 alt: 0.0_f32,
31857 climb: 0.0_f32,
31858 heading: 0_i16,
31859 throttle: 0_u16,
31860 };
31861 #[cfg(feature = "arbitrary")]
31862 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31863 use arbitrary::{Arbitrary, Unstructured};
31864 let mut buf = [0u8; 1024];
31865 rng.fill_bytes(&mut buf);
31866 let mut unstructured = Unstructured::new(&buf);
31867 Self::arbitrary(&mut unstructured).unwrap_or_default()
31868 }
31869}
31870impl Default for VFR_HUD_DATA {
31871 fn default() -> Self {
31872 Self::DEFAULT.clone()
31873 }
31874}
31875impl MessageData for VFR_HUD_DATA {
31876 type Message = MavMessage;
31877 const ID: u32 = 74u32;
31878 const NAME: &'static str = "VFR_HUD";
31879 const EXTRA_CRC: u8 = 20u8;
31880 const ENCODED_LEN: usize = 20usize;
31881 fn deser(
31882 _version: MavlinkVersion,
31883 __input: &[u8],
31884 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31885 let avail_len = __input.len();
31886 let mut payload_buf = [0; Self::ENCODED_LEN];
31887 let mut buf = if avail_len < Self::ENCODED_LEN {
31888 payload_buf[0..avail_len].copy_from_slice(__input);
31889 Bytes::new(&payload_buf)
31890 } else {
31891 Bytes::new(__input)
31892 };
31893 let mut __struct = Self::default();
31894 __struct.airspeed = buf.get_f32_le();
31895 __struct.groundspeed = buf.get_f32_le();
31896 __struct.alt = buf.get_f32_le();
31897 __struct.climb = buf.get_f32_le();
31898 __struct.heading = buf.get_i16_le();
31899 __struct.throttle = buf.get_u16_le();
31900 Ok(__struct)
31901 }
31902 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31903 let mut __tmp = BytesMut::new(bytes);
31904 #[allow(clippy::absurd_extreme_comparisons)]
31905 #[allow(unused_comparisons)]
31906 if __tmp.remaining() < Self::ENCODED_LEN {
31907 panic!(
31908 "buffer is too small (need {} bytes, but got {})",
31909 Self::ENCODED_LEN,
31910 __tmp.remaining(),
31911 )
31912 }
31913 __tmp.put_f32_le(self.airspeed);
31914 __tmp.put_f32_le(self.groundspeed);
31915 __tmp.put_f32_le(self.alt);
31916 __tmp.put_f32_le(self.climb);
31917 __tmp.put_i16_le(self.heading);
31918 __tmp.put_u16_le(self.throttle);
31919 if matches!(version, MavlinkVersion::V2) {
31920 let len = __tmp.len();
31921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31922 } else {
31923 __tmp.len()
31924 }
31925 }
31926}
31927#[doc = "id: 241"]
31928#[doc = "Vibration levels and accelerometer clipping."]
31929#[derive(Debug, Clone, PartialEq)]
31930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31932pub struct VIBRATION_DATA {
31933 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31934 pub time_usec: u64,
31935 #[doc = "Vibration levels on X-axis"]
31936 pub vibration_x: f32,
31937 #[doc = "Vibration levels on Y-axis"]
31938 pub vibration_y: f32,
31939 #[doc = "Vibration levels on Z-axis"]
31940 pub vibration_z: f32,
31941 #[doc = "first accelerometer clipping count"]
31942 pub clipping_0: u32,
31943 #[doc = "second accelerometer clipping count"]
31944 pub clipping_1: u32,
31945 #[doc = "third accelerometer clipping count"]
31946 pub clipping_2: u32,
31947}
31948impl VIBRATION_DATA {
31949 pub const ENCODED_LEN: usize = 32usize;
31950 pub const DEFAULT: Self = Self {
31951 time_usec: 0_u64,
31952 vibration_x: 0.0_f32,
31953 vibration_y: 0.0_f32,
31954 vibration_z: 0.0_f32,
31955 clipping_0: 0_u32,
31956 clipping_1: 0_u32,
31957 clipping_2: 0_u32,
31958 };
31959 #[cfg(feature = "arbitrary")]
31960 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31961 use arbitrary::{Arbitrary, Unstructured};
31962 let mut buf = [0u8; 1024];
31963 rng.fill_bytes(&mut buf);
31964 let mut unstructured = Unstructured::new(&buf);
31965 Self::arbitrary(&mut unstructured).unwrap_or_default()
31966 }
31967}
31968impl Default for VIBRATION_DATA {
31969 fn default() -> Self {
31970 Self::DEFAULT.clone()
31971 }
31972}
31973impl MessageData for VIBRATION_DATA {
31974 type Message = MavMessage;
31975 const ID: u32 = 241u32;
31976 const NAME: &'static str = "VIBRATION";
31977 const EXTRA_CRC: u8 = 90u8;
31978 const ENCODED_LEN: usize = 32usize;
31979 fn deser(
31980 _version: MavlinkVersion,
31981 __input: &[u8],
31982 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31983 let avail_len = __input.len();
31984 let mut payload_buf = [0; Self::ENCODED_LEN];
31985 let mut buf = if avail_len < Self::ENCODED_LEN {
31986 payload_buf[0..avail_len].copy_from_slice(__input);
31987 Bytes::new(&payload_buf)
31988 } else {
31989 Bytes::new(__input)
31990 };
31991 let mut __struct = Self::default();
31992 __struct.time_usec = buf.get_u64_le();
31993 __struct.vibration_x = buf.get_f32_le();
31994 __struct.vibration_y = buf.get_f32_le();
31995 __struct.vibration_z = buf.get_f32_le();
31996 __struct.clipping_0 = buf.get_u32_le();
31997 __struct.clipping_1 = buf.get_u32_le();
31998 __struct.clipping_2 = buf.get_u32_le();
31999 Ok(__struct)
32000 }
32001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32002 let mut __tmp = BytesMut::new(bytes);
32003 #[allow(clippy::absurd_extreme_comparisons)]
32004 #[allow(unused_comparisons)]
32005 if __tmp.remaining() < Self::ENCODED_LEN {
32006 panic!(
32007 "buffer is too small (need {} bytes, but got {})",
32008 Self::ENCODED_LEN,
32009 __tmp.remaining(),
32010 )
32011 }
32012 __tmp.put_u64_le(self.time_usec);
32013 __tmp.put_f32_le(self.vibration_x);
32014 __tmp.put_f32_le(self.vibration_y);
32015 __tmp.put_f32_le(self.vibration_z);
32016 __tmp.put_u32_le(self.clipping_0);
32017 __tmp.put_u32_le(self.clipping_1);
32018 __tmp.put_u32_le(self.clipping_2);
32019 if matches!(version, MavlinkVersion::V2) {
32020 let len = __tmp.len();
32021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32022 } else {
32023 __tmp.len()
32024 }
32025 }
32026}
32027#[doc = "id: 104"]
32028#[doc = "Global position estimate from a Vicon motion system source."]
32029#[derive(Debug, Clone, PartialEq)]
32030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32032pub struct VICON_POSITION_ESTIMATE_DATA {
32033 #[doc = "Timestamp (UNIX time or time since system boot)"]
32034 pub usec: u64,
32035 #[doc = "Global X position"]
32036 pub x: f32,
32037 #[doc = "Global Y position"]
32038 pub y: f32,
32039 #[doc = "Global Z position"]
32040 pub z: f32,
32041 #[doc = "Roll angle"]
32042 pub roll: f32,
32043 #[doc = "Pitch angle"]
32044 pub pitch: f32,
32045 #[doc = "Yaw angle"]
32046 pub yaw: f32,
32047 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
32048 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32049 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32050 pub covariance: [f32; 21],
32051}
32052impl VICON_POSITION_ESTIMATE_DATA {
32053 pub const ENCODED_LEN: usize = 116usize;
32054 pub const DEFAULT: Self = Self {
32055 usec: 0_u64,
32056 x: 0.0_f32,
32057 y: 0.0_f32,
32058 z: 0.0_f32,
32059 roll: 0.0_f32,
32060 pitch: 0.0_f32,
32061 yaw: 0.0_f32,
32062 covariance: [0.0_f32; 21usize],
32063 };
32064 #[cfg(feature = "arbitrary")]
32065 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32066 use arbitrary::{Arbitrary, Unstructured};
32067 let mut buf = [0u8; 1024];
32068 rng.fill_bytes(&mut buf);
32069 let mut unstructured = Unstructured::new(&buf);
32070 Self::arbitrary(&mut unstructured).unwrap_or_default()
32071 }
32072}
32073impl Default for VICON_POSITION_ESTIMATE_DATA {
32074 fn default() -> Self {
32075 Self::DEFAULT.clone()
32076 }
32077}
32078impl MessageData for VICON_POSITION_ESTIMATE_DATA {
32079 type Message = MavMessage;
32080 const ID: u32 = 104u32;
32081 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
32082 const EXTRA_CRC: u8 = 56u8;
32083 const ENCODED_LEN: usize = 116usize;
32084 fn deser(
32085 _version: MavlinkVersion,
32086 __input: &[u8],
32087 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32088 let avail_len = __input.len();
32089 let mut payload_buf = [0; Self::ENCODED_LEN];
32090 let mut buf = if avail_len < Self::ENCODED_LEN {
32091 payload_buf[0..avail_len].copy_from_slice(__input);
32092 Bytes::new(&payload_buf)
32093 } else {
32094 Bytes::new(__input)
32095 };
32096 let mut __struct = Self::default();
32097 __struct.usec = buf.get_u64_le();
32098 __struct.x = buf.get_f32_le();
32099 __struct.y = buf.get_f32_le();
32100 __struct.z = buf.get_f32_le();
32101 __struct.roll = buf.get_f32_le();
32102 __struct.pitch = buf.get_f32_le();
32103 __struct.yaw = buf.get_f32_le();
32104 for v in &mut __struct.covariance {
32105 let val = buf.get_f32_le();
32106 *v = val;
32107 }
32108 Ok(__struct)
32109 }
32110 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32111 let mut __tmp = BytesMut::new(bytes);
32112 #[allow(clippy::absurd_extreme_comparisons)]
32113 #[allow(unused_comparisons)]
32114 if __tmp.remaining() < Self::ENCODED_LEN {
32115 panic!(
32116 "buffer is too small (need {} bytes, but got {})",
32117 Self::ENCODED_LEN,
32118 __tmp.remaining(),
32119 )
32120 }
32121 __tmp.put_u64_le(self.usec);
32122 __tmp.put_f32_le(self.x);
32123 __tmp.put_f32_le(self.y);
32124 __tmp.put_f32_le(self.z);
32125 __tmp.put_f32_le(self.roll);
32126 __tmp.put_f32_le(self.pitch);
32127 __tmp.put_f32_le(self.yaw);
32128 for val in &self.covariance {
32129 __tmp.put_f32_le(*val);
32130 }
32131 if matches!(version, MavlinkVersion::V2) {
32132 let len = __tmp.len();
32133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32134 } else {
32135 __tmp.len()
32136 }
32137 }
32138}
32139#[doc = "id: 269"]
32140#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
32141#[derive(Debug, Clone, PartialEq)]
32142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32144pub struct VIDEO_STREAM_INFORMATION_DATA {
32145 #[doc = "Frame rate."]
32146 pub framerate: f32,
32147 #[doc = "Bit rate."]
32148 pub bitrate: u32,
32149 #[doc = "Bitmap of stream status flags."]
32150 pub flags: VideoStreamStatusFlags,
32151 #[doc = "Horizontal resolution."]
32152 pub resolution_h: u16,
32153 #[doc = "Vertical resolution."]
32154 pub resolution_v: u16,
32155 #[doc = "Video image rotation clockwise."]
32156 pub rotation: u16,
32157 #[doc = "Horizontal Field of view."]
32158 pub hfov: u16,
32159 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32160 pub stream_id: u8,
32161 #[doc = "Number of streams available."]
32162 pub count: u8,
32163 #[doc = "Type of stream."]
32164 pub mavtype: VideoStreamType,
32165 #[doc = "Stream name."]
32166 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32167 pub name: [u8; 32],
32168 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
32169 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32170 pub uri: [u8; 160],
32171 #[doc = "Encoding of stream."]
32172 #[cfg_attr(feature = "serde", serde(default))]
32173 pub encoding: VideoStreamEncoding,
32174 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32175 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32176 pub camera_device_id: u8,
32177}
32178impl VIDEO_STREAM_INFORMATION_DATA {
32179 pub const ENCODED_LEN: usize = 215usize;
32180 pub const DEFAULT: Self = Self {
32181 framerate: 0.0_f32,
32182 bitrate: 0_u32,
32183 flags: VideoStreamStatusFlags::DEFAULT,
32184 resolution_h: 0_u16,
32185 resolution_v: 0_u16,
32186 rotation: 0_u16,
32187 hfov: 0_u16,
32188 stream_id: 0_u8,
32189 count: 0_u8,
32190 mavtype: VideoStreamType::DEFAULT,
32191 name: [0_u8; 32usize],
32192 uri: [0_u8; 160usize],
32193 encoding: VideoStreamEncoding::DEFAULT,
32194 camera_device_id: 0_u8,
32195 };
32196 #[cfg(feature = "arbitrary")]
32197 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32198 use arbitrary::{Arbitrary, Unstructured};
32199 let mut buf = [0u8; 1024];
32200 rng.fill_bytes(&mut buf);
32201 let mut unstructured = Unstructured::new(&buf);
32202 Self::arbitrary(&mut unstructured).unwrap_or_default()
32203 }
32204}
32205impl Default for VIDEO_STREAM_INFORMATION_DATA {
32206 fn default() -> Self {
32207 Self::DEFAULT.clone()
32208 }
32209}
32210impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
32211 type Message = MavMessage;
32212 const ID: u32 = 269u32;
32213 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
32214 const EXTRA_CRC: u8 = 109u8;
32215 const ENCODED_LEN: usize = 215usize;
32216 fn deser(
32217 _version: MavlinkVersion,
32218 __input: &[u8],
32219 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32220 let avail_len = __input.len();
32221 let mut payload_buf = [0; Self::ENCODED_LEN];
32222 let mut buf = if avail_len < Self::ENCODED_LEN {
32223 payload_buf[0..avail_len].copy_from_slice(__input);
32224 Bytes::new(&payload_buf)
32225 } else {
32226 Bytes::new(__input)
32227 };
32228 let mut __struct = Self::default();
32229 __struct.framerate = buf.get_f32_le();
32230 __struct.bitrate = buf.get_u32_le();
32231 let tmp = buf.get_u16_le();
32232 __struct.flags = VideoStreamStatusFlags::from_bits(
32233 tmp & VideoStreamStatusFlags::all().bits(),
32234 )
32235 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32236 flag_type: "VideoStreamStatusFlags",
32237 value: tmp as u32,
32238 })?;
32239 __struct.resolution_h = buf.get_u16_le();
32240 __struct.resolution_v = buf.get_u16_le();
32241 __struct.rotation = buf.get_u16_le();
32242 __struct.hfov = buf.get_u16_le();
32243 __struct.stream_id = buf.get_u8();
32244 __struct.count = buf.get_u8();
32245 let tmp = buf.get_u8();
32246 __struct.mavtype =
32247 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32248 enum_type: "VideoStreamType",
32249 value: tmp as u32,
32250 })?;
32251 for v in &mut __struct.name {
32252 let val = buf.get_u8();
32253 *v = val;
32254 }
32255 for v in &mut __struct.uri {
32256 let val = buf.get_u8();
32257 *v = val;
32258 }
32259 let tmp = buf.get_u8();
32260 __struct.encoding =
32261 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32262 enum_type: "VideoStreamEncoding",
32263 value: tmp as u32,
32264 })?;
32265 __struct.camera_device_id = buf.get_u8();
32266 Ok(__struct)
32267 }
32268 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32269 let mut __tmp = BytesMut::new(bytes);
32270 #[allow(clippy::absurd_extreme_comparisons)]
32271 #[allow(unused_comparisons)]
32272 if __tmp.remaining() < Self::ENCODED_LEN {
32273 panic!(
32274 "buffer is too small (need {} bytes, but got {})",
32275 Self::ENCODED_LEN,
32276 __tmp.remaining(),
32277 )
32278 }
32279 __tmp.put_f32_le(self.framerate);
32280 __tmp.put_u32_le(self.bitrate);
32281 __tmp.put_u16_le(self.flags.bits());
32282 __tmp.put_u16_le(self.resolution_h);
32283 __tmp.put_u16_le(self.resolution_v);
32284 __tmp.put_u16_le(self.rotation);
32285 __tmp.put_u16_le(self.hfov);
32286 __tmp.put_u8(self.stream_id);
32287 __tmp.put_u8(self.count);
32288 __tmp.put_u8(self.mavtype as u8);
32289 for val in &self.name {
32290 __tmp.put_u8(*val);
32291 }
32292 for val in &self.uri {
32293 __tmp.put_u8(*val);
32294 }
32295 __tmp.put_u8(self.encoding as u8);
32296 __tmp.put_u8(self.camera_device_id);
32297 if matches!(version, MavlinkVersion::V2) {
32298 let len = __tmp.len();
32299 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32300 } else {
32301 __tmp.len()
32302 }
32303 }
32304}
32305#[doc = "id: 270"]
32306#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32307#[derive(Debug, Clone, PartialEq)]
32308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32309#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32310pub struct VIDEO_STREAM_STATUS_DATA {
32311 #[doc = "Frame rate"]
32312 pub framerate: f32,
32313 #[doc = "Bit rate"]
32314 pub bitrate: u32,
32315 #[doc = "Bitmap of stream status flags"]
32316 pub flags: VideoStreamStatusFlags,
32317 #[doc = "Horizontal resolution"]
32318 pub resolution_h: u16,
32319 #[doc = "Vertical resolution"]
32320 pub resolution_v: u16,
32321 #[doc = "Video image rotation clockwise"]
32322 pub rotation: u16,
32323 #[doc = "Horizontal Field of view"]
32324 pub hfov: u16,
32325 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32326 pub stream_id: u8,
32327 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32329 pub camera_device_id: u8,
32330}
32331impl VIDEO_STREAM_STATUS_DATA {
32332 pub const ENCODED_LEN: usize = 20usize;
32333 pub const DEFAULT: Self = Self {
32334 framerate: 0.0_f32,
32335 bitrate: 0_u32,
32336 flags: VideoStreamStatusFlags::DEFAULT,
32337 resolution_h: 0_u16,
32338 resolution_v: 0_u16,
32339 rotation: 0_u16,
32340 hfov: 0_u16,
32341 stream_id: 0_u8,
32342 camera_device_id: 0_u8,
32343 };
32344 #[cfg(feature = "arbitrary")]
32345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32346 use arbitrary::{Arbitrary, Unstructured};
32347 let mut buf = [0u8; 1024];
32348 rng.fill_bytes(&mut buf);
32349 let mut unstructured = Unstructured::new(&buf);
32350 Self::arbitrary(&mut unstructured).unwrap_or_default()
32351 }
32352}
32353impl Default for VIDEO_STREAM_STATUS_DATA {
32354 fn default() -> Self {
32355 Self::DEFAULT.clone()
32356 }
32357}
32358impl MessageData for VIDEO_STREAM_STATUS_DATA {
32359 type Message = MavMessage;
32360 const ID: u32 = 270u32;
32361 const NAME: &'static str = "VIDEO_STREAM_STATUS";
32362 const EXTRA_CRC: u8 = 59u8;
32363 const ENCODED_LEN: usize = 20usize;
32364 fn deser(
32365 _version: MavlinkVersion,
32366 __input: &[u8],
32367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32368 let avail_len = __input.len();
32369 let mut payload_buf = [0; Self::ENCODED_LEN];
32370 let mut buf = if avail_len < Self::ENCODED_LEN {
32371 payload_buf[0..avail_len].copy_from_slice(__input);
32372 Bytes::new(&payload_buf)
32373 } else {
32374 Bytes::new(__input)
32375 };
32376 let mut __struct = Self::default();
32377 __struct.framerate = buf.get_f32_le();
32378 __struct.bitrate = buf.get_u32_le();
32379 let tmp = buf.get_u16_le();
32380 __struct.flags = VideoStreamStatusFlags::from_bits(
32381 tmp & VideoStreamStatusFlags::all().bits(),
32382 )
32383 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32384 flag_type: "VideoStreamStatusFlags",
32385 value: tmp as u32,
32386 })?;
32387 __struct.resolution_h = buf.get_u16_le();
32388 __struct.resolution_v = buf.get_u16_le();
32389 __struct.rotation = buf.get_u16_le();
32390 __struct.hfov = buf.get_u16_le();
32391 __struct.stream_id = buf.get_u8();
32392 __struct.camera_device_id = buf.get_u8();
32393 Ok(__struct)
32394 }
32395 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32396 let mut __tmp = BytesMut::new(bytes);
32397 #[allow(clippy::absurd_extreme_comparisons)]
32398 #[allow(unused_comparisons)]
32399 if __tmp.remaining() < Self::ENCODED_LEN {
32400 panic!(
32401 "buffer is too small (need {} bytes, but got {})",
32402 Self::ENCODED_LEN,
32403 __tmp.remaining(),
32404 )
32405 }
32406 __tmp.put_f32_le(self.framerate);
32407 __tmp.put_u32_le(self.bitrate);
32408 __tmp.put_u16_le(self.flags.bits());
32409 __tmp.put_u16_le(self.resolution_h);
32410 __tmp.put_u16_le(self.resolution_v);
32411 __tmp.put_u16_le(self.rotation);
32412 __tmp.put_u16_le(self.hfov);
32413 __tmp.put_u8(self.stream_id);
32414 __tmp.put_u8(self.camera_device_id);
32415 if matches!(version, MavlinkVersion::V2) {
32416 let len = __tmp.len();
32417 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32418 } else {
32419 __tmp.len()
32420 }
32421 }
32422}
32423#[doc = "id: 102"]
32424#[doc = "Local position/attitude estimate from a vision source."]
32425#[derive(Debug, Clone, PartialEq)]
32426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32428pub struct VISION_POSITION_ESTIMATE_DATA {
32429 #[doc = "Timestamp (UNIX time or time since system boot)"]
32430 pub usec: u64,
32431 #[doc = "Local X position"]
32432 pub x: f32,
32433 #[doc = "Local Y position"]
32434 pub y: f32,
32435 #[doc = "Local Z position"]
32436 pub z: f32,
32437 #[doc = "Roll angle"]
32438 pub roll: f32,
32439 #[doc = "Pitch angle"]
32440 pub pitch: f32,
32441 #[doc = "Yaw angle"]
32442 pub yaw: f32,
32443 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
32444 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32445 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32446 pub covariance: [f32; 21],
32447 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32448 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32449 pub reset_counter: u8,
32450}
32451impl VISION_POSITION_ESTIMATE_DATA {
32452 pub const ENCODED_LEN: usize = 117usize;
32453 pub const DEFAULT: Self = Self {
32454 usec: 0_u64,
32455 x: 0.0_f32,
32456 y: 0.0_f32,
32457 z: 0.0_f32,
32458 roll: 0.0_f32,
32459 pitch: 0.0_f32,
32460 yaw: 0.0_f32,
32461 covariance: [0.0_f32; 21usize],
32462 reset_counter: 0_u8,
32463 };
32464 #[cfg(feature = "arbitrary")]
32465 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32466 use arbitrary::{Arbitrary, Unstructured};
32467 let mut buf = [0u8; 1024];
32468 rng.fill_bytes(&mut buf);
32469 let mut unstructured = Unstructured::new(&buf);
32470 Self::arbitrary(&mut unstructured).unwrap_or_default()
32471 }
32472}
32473impl Default for VISION_POSITION_ESTIMATE_DATA {
32474 fn default() -> Self {
32475 Self::DEFAULT.clone()
32476 }
32477}
32478impl MessageData for VISION_POSITION_ESTIMATE_DATA {
32479 type Message = MavMessage;
32480 const ID: u32 = 102u32;
32481 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
32482 const EXTRA_CRC: u8 = 158u8;
32483 const ENCODED_LEN: usize = 117usize;
32484 fn deser(
32485 _version: MavlinkVersion,
32486 __input: &[u8],
32487 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32488 let avail_len = __input.len();
32489 let mut payload_buf = [0; Self::ENCODED_LEN];
32490 let mut buf = if avail_len < Self::ENCODED_LEN {
32491 payload_buf[0..avail_len].copy_from_slice(__input);
32492 Bytes::new(&payload_buf)
32493 } else {
32494 Bytes::new(__input)
32495 };
32496 let mut __struct = Self::default();
32497 __struct.usec = buf.get_u64_le();
32498 __struct.x = buf.get_f32_le();
32499 __struct.y = buf.get_f32_le();
32500 __struct.z = buf.get_f32_le();
32501 __struct.roll = buf.get_f32_le();
32502 __struct.pitch = buf.get_f32_le();
32503 __struct.yaw = buf.get_f32_le();
32504 for v in &mut __struct.covariance {
32505 let val = buf.get_f32_le();
32506 *v = val;
32507 }
32508 __struct.reset_counter = buf.get_u8();
32509 Ok(__struct)
32510 }
32511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32512 let mut __tmp = BytesMut::new(bytes);
32513 #[allow(clippy::absurd_extreme_comparisons)]
32514 #[allow(unused_comparisons)]
32515 if __tmp.remaining() < Self::ENCODED_LEN {
32516 panic!(
32517 "buffer is too small (need {} bytes, but got {})",
32518 Self::ENCODED_LEN,
32519 __tmp.remaining(),
32520 )
32521 }
32522 __tmp.put_u64_le(self.usec);
32523 __tmp.put_f32_le(self.x);
32524 __tmp.put_f32_le(self.y);
32525 __tmp.put_f32_le(self.z);
32526 __tmp.put_f32_le(self.roll);
32527 __tmp.put_f32_le(self.pitch);
32528 __tmp.put_f32_le(self.yaw);
32529 for val in &self.covariance {
32530 __tmp.put_f32_le(*val);
32531 }
32532 __tmp.put_u8(self.reset_counter);
32533 if matches!(version, MavlinkVersion::V2) {
32534 let len = __tmp.len();
32535 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32536 } else {
32537 __tmp.len()
32538 }
32539 }
32540}
32541#[doc = "id: 103"]
32542#[doc = "Speed estimate from a vision source."]
32543#[derive(Debug, Clone, PartialEq)]
32544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32546pub struct VISION_SPEED_ESTIMATE_DATA {
32547 #[doc = "Timestamp (UNIX time or time since system boot)"]
32548 pub usec: u64,
32549 #[doc = "Global X speed"]
32550 pub x: f32,
32551 #[doc = "Global Y speed"]
32552 pub y: f32,
32553 #[doc = "Global Z speed"]
32554 pub z: f32,
32555 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
32556 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32557 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32558 pub covariance: [f32; 9],
32559 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32560 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32561 pub reset_counter: u8,
32562}
32563impl VISION_SPEED_ESTIMATE_DATA {
32564 pub const ENCODED_LEN: usize = 57usize;
32565 pub const DEFAULT: Self = Self {
32566 usec: 0_u64,
32567 x: 0.0_f32,
32568 y: 0.0_f32,
32569 z: 0.0_f32,
32570 covariance: [0.0_f32; 9usize],
32571 reset_counter: 0_u8,
32572 };
32573 #[cfg(feature = "arbitrary")]
32574 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32575 use arbitrary::{Arbitrary, Unstructured};
32576 let mut buf = [0u8; 1024];
32577 rng.fill_bytes(&mut buf);
32578 let mut unstructured = Unstructured::new(&buf);
32579 Self::arbitrary(&mut unstructured).unwrap_or_default()
32580 }
32581}
32582impl Default for VISION_SPEED_ESTIMATE_DATA {
32583 fn default() -> Self {
32584 Self::DEFAULT.clone()
32585 }
32586}
32587impl MessageData for VISION_SPEED_ESTIMATE_DATA {
32588 type Message = MavMessage;
32589 const ID: u32 = 103u32;
32590 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
32591 const EXTRA_CRC: u8 = 208u8;
32592 const ENCODED_LEN: usize = 57usize;
32593 fn deser(
32594 _version: MavlinkVersion,
32595 __input: &[u8],
32596 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32597 let avail_len = __input.len();
32598 let mut payload_buf = [0; Self::ENCODED_LEN];
32599 let mut buf = if avail_len < Self::ENCODED_LEN {
32600 payload_buf[0..avail_len].copy_from_slice(__input);
32601 Bytes::new(&payload_buf)
32602 } else {
32603 Bytes::new(__input)
32604 };
32605 let mut __struct = Self::default();
32606 __struct.usec = buf.get_u64_le();
32607 __struct.x = buf.get_f32_le();
32608 __struct.y = buf.get_f32_le();
32609 __struct.z = buf.get_f32_le();
32610 for v in &mut __struct.covariance {
32611 let val = buf.get_f32_le();
32612 *v = val;
32613 }
32614 __struct.reset_counter = buf.get_u8();
32615 Ok(__struct)
32616 }
32617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32618 let mut __tmp = BytesMut::new(bytes);
32619 #[allow(clippy::absurd_extreme_comparisons)]
32620 #[allow(unused_comparisons)]
32621 if __tmp.remaining() < Self::ENCODED_LEN {
32622 panic!(
32623 "buffer is too small (need {} bytes, but got {})",
32624 Self::ENCODED_LEN,
32625 __tmp.remaining(),
32626 )
32627 }
32628 __tmp.put_u64_le(self.usec);
32629 __tmp.put_f32_le(self.x);
32630 __tmp.put_f32_le(self.y);
32631 __tmp.put_f32_le(self.z);
32632 for val in &self.covariance {
32633 __tmp.put_f32_le(*val);
32634 }
32635 __tmp.put_u8(self.reset_counter);
32636 if matches!(version, MavlinkVersion::V2) {
32637 let len = __tmp.len();
32638 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32639 } else {
32640 __tmp.len()
32641 }
32642 }
32643}
32644#[doc = "id: 9000"]
32645#[doc = "Cumulative distance traveled for each reported wheel."]
32646#[derive(Debug, Clone, PartialEq)]
32647#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32649pub struct WHEEL_DISTANCE_DATA {
32650 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32651 pub time_usec: u64,
32652 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32653 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32654 pub distance: [f64; 16],
32655 #[doc = "Number of wheels reported."]
32656 pub count: u8,
32657}
32658impl WHEEL_DISTANCE_DATA {
32659 pub const ENCODED_LEN: usize = 137usize;
32660 pub const DEFAULT: Self = Self {
32661 time_usec: 0_u64,
32662 distance: [0.0_f64; 16usize],
32663 count: 0_u8,
32664 };
32665 #[cfg(feature = "arbitrary")]
32666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32667 use arbitrary::{Arbitrary, Unstructured};
32668 let mut buf = [0u8; 1024];
32669 rng.fill_bytes(&mut buf);
32670 let mut unstructured = Unstructured::new(&buf);
32671 Self::arbitrary(&mut unstructured).unwrap_or_default()
32672 }
32673}
32674impl Default for WHEEL_DISTANCE_DATA {
32675 fn default() -> Self {
32676 Self::DEFAULT.clone()
32677 }
32678}
32679impl MessageData for WHEEL_DISTANCE_DATA {
32680 type Message = MavMessage;
32681 const ID: u32 = 9000u32;
32682 const NAME: &'static str = "WHEEL_DISTANCE";
32683 const EXTRA_CRC: u8 = 113u8;
32684 const ENCODED_LEN: usize = 137usize;
32685 fn deser(
32686 _version: MavlinkVersion,
32687 __input: &[u8],
32688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32689 let avail_len = __input.len();
32690 let mut payload_buf = [0; Self::ENCODED_LEN];
32691 let mut buf = if avail_len < Self::ENCODED_LEN {
32692 payload_buf[0..avail_len].copy_from_slice(__input);
32693 Bytes::new(&payload_buf)
32694 } else {
32695 Bytes::new(__input)
32696 };
32697 let mut __struct = Self::default();
32698 __struct.time_usec = buf.get_u64_le();
32699 for v in &mut __struct.distance {
32700 let val = buf.get_f64_le();
32701 *v = val;
32702 }
32703 __struct.count = buf.get_u8();
32704 Ok(__struct)
32705 }
32706 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32707 let mut __tmp = BytesMut::new(bytes);
32708 #[allow(clippy::absurd_extreme_comparisons)]
32709 #[allow(unused_comparisons)]
32710 if __tmp.remaining() < Self::ENCODED_LEN {
32711 panic!(
32712 "buffer is too small (need {} bytes, but got {})",
32713 Self::ENCODED_LEN,
32714 __tmp.remaining(),
32715 )
32716 }
32717 __tmp.put_u64_le(self.time_usec);
32718 for val in &self.distance {
32719 __tmp.put_f64_le(*val);
32720 }
32721 __tmp.put_u8(self.count);
32722 if matches!(version, MavlinkVersion::V2) {
32723 let len = __tmp.len();
32724 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32725 } else {
32726 __tmp.len()
32727 }
32728 }
32729}
32730#[doc = "id: 299"]
32731#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32732#[derive(Debug, Clone, PartialEq)]
32733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32735pub struct WIFI_CONFIG_AP_DATA {
32736 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32737 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32738 pub ssid: [u8; 32],
32739 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32740 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32741 pub password: [u8; 64],
32742 #[doc = "WiFi Mode."]
32743 #[cfg_attr(feature = "serde", serde(default))]
32744 pub mode: WifiConfigApMode,
32745 #[doc = "Message acceptance response (sent back to GS)."]
32746 #[cfg_attr(feature = "serde", serde(default))]
32747 pub response: WifiConfigApResponse,
32748}
32749impl WIFI_CONFIG_AP_DATA {
32750 pub const ENCODED_LEN: usize = 98usize;
32751 pub const DEFAULT: Self = Self {
32752 ssid: [0_u8; 32usize],
32753 password: [0_u8; 64usize],
32754 mode: WifiConfigApMode::DEFAULT,
32755 response: WifiConfigApResponse::DEFAULT,
32756 };
32757 #[cfg(feature = "arbitrary")]
32758 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32759 use arbitrary::{Arbitrary, Unstructured};
32760 let mut buf = [0u8; 1024];
32761 rng.fill_bytes(&mut buf);
32762 let mut unstructured = Unstructured::new(&buf);
32763 Self::arbitrary(&mut unstructured).unwrap_or_default()
32764 }
32765}
32766impl Default for WIFI_CONFIG_AP_DATA {
32767 fn default() -> Self {
32768 Self::DEFAULT.clone()
32769 }
32770}
32771impl MessageData for WIFI_CONFIG_AP_DATA {
32772 type Message = MavMessage;
32773 const ID: u32 = 299u32;
32774 const NAME: &'static str = "WIFI_CONFIG_AP";
32775 const EXTRA_CRC: u8 = 19u8;
32776 const ENCODED_LEN: usize = 98usize;
32777 fn deser(
32778 _version: MavlinkVersion,
32779 __input: &[u8],
32780 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32781 let avail_len = __input.len();
32782 let mut payload_buf = [0; Self::ENCODED_LEN];
32783 let mut buf = if avail_len < Self::ENCODED_LEN {
32784 payload_buf[0..avail_len].copy_from_slice(__input);
32785 Bytes::new(&payload_buf)
32786 } else {
32787 Bytes::new(__input)
32788 };
32789 let mut __struct = Self::default();
32790 for v in &mut __struct.ssid {
32791 let val = buf.get_u8();
32792 *v = val;
32793 }
32794 for v in &mut __struct.password {
32795 let val = buf.get_u8();
32796 *v = val;
32797 }
32798 let tmp = buf.get_i8();
32799 __struct.mode =
32800 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32801 enum_type: "WifiConfigApMode",
32802 value: tmp as u32,
32803 })?;
32804 let tmp = buf.get_i8();
32805 __struct.response =
32806 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32807 enum_type: "WifiConfigApResponse",
32808 value: tmp as u32,
32809 })?;
32810 Ok(__struct)
32811 }
32812 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32813 let mut __tmp = BytesMut::new(bytes);
32814 #[allow(clippy::absurd_extreme_comparisons)]
32815 #[allow(unused_comparisons)]
32816 if __tmp.remaining() < Self::ENCODED_LEN {
32817 panic!(
32818 "buffer is too small (need {} bytes, but got {})",
32819 Self::ENCODED_LEN,
32820 __tmp.remaining(),
32821 )
32822 }
32823 for val in &self.ssid {
32824 __tmp.put_u8(*val);
32825 }
32826 for val in &self.password {
32827 __tmp.put_u8(*val);
32828 }
32829 __tmp.put_i8(self.mode as i8);
32830 __tmp.put_i8(self.response as i8);
32831 if matches!(version, MavlinkVersion::V2) {
32832 let len = __tmp.len();
32833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32834 } else {
32835 __tmp.len()
32836 }
32837 }
32838}
32839#[doc = "id: 9005"]
32840#[doc = "Winch status."]
32841#[derive(Debug, Clone, PartialEq)]
32842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32844pub struct WINCH_STATUS_DATA {
32845 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32846 pub time_usec: u64,
32847 #[doc = "Length of line released. NaN if unknown"]
32848 pub line_length: f32,
32849 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32850 pub speed: f32,
32851 #[doc = "Tension on the line. NaN if unknown"]
32852 pub tension: f32,
32853 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32854 pub voltage: f32,
32855 #[doc = "Current draw from the winch. NaN if unknown"]
32856 pub current: f32,
32857 #[doc = "Status flags"]
32858 pub status: MavWinchStatusFlag,
32859 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32860 pub temperature: i16,
32861}
32862impl WINCH_STATUS_DATA {
32863 pub const ENCODED_LEN: usize = 34usize;
32864 pub const DEFAULT: Self = Self {
32865 time_usec: 0_u64,
32866 line_length: 0.0_f32,
32867 speed: 0.0_f32,
32868 tension: 0.0_f32,
32869 voltage: 0.0_f32,
32870 current: 0.0_f32,
32871 status: MavWinchStatusFlag::DEFAULT,
32872 temperature: 0_i16,
32873 };
32874 #[cfg(feature = "arbitrary")]
32875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32876 use arbitrary::{Arbitrary, Unstructured};
32877 let mut buf = [0u8; 1024];
32878 rng.fill_bytes(&mut buf);
32879 let mut unstructured = Unstructured::new(&buf);
32880 Self::arbitrary(&mut unstructured).unwrap_or_default()
32881 }
32882}
32883impl Default for WINCH_STATUS_DATA {
32884 fn default() -> Self {
32885 Self::DEFAULT.clone()
32886 }
32887}
32888impl MessageData for WINCH_STATUS_DATA {
32889 type Message = MavMessage;
32890 const ID: u32 = 9005u32;
32891 const NAME: &'static str = "WINCH_STATUS";
32892 const EXTRA_CRC: u8 = 117u8;
32893 const ENCODED_LEN: usize = 34usize;
32894 fn deser(
32895 _version: MavlinkVersion,
32896 __input: &[u8],
32897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32898 let avail_len = __input.len();
32899 let mut payload_buf = [0; Self::ENCODED_LEN];
32900 let mut buf = if avail_len < Self::ENCODED_LEN {
32901 payload_buf[0..avail_len].copy_from_slice(__input);
32902 Bytes::new(&payload_buf)
32903 } else {
32904 Bytes::new(__input)
32905 };
32906 let mut __struct = Self::default();
32907 __struct.time_usec = buf.get_u64_le();
32908 __struct.line_length = buf.get_f32_le();
32909 __struct.speed = buf.get_f32_le();
32910 __struct.tension = buf.get_f32_le();
32911 __struct.voltage = buf.get_f32_le();
32912 __struct.current = buf.get_f32_le();
32913 let tmp = buf.get_u32_le();
32914 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
32915 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32916 flag_type: "MavWinchStatusFlag",
32917 value: tmp as u32,
32918 })?;
32919 __struct.temperature = buf.get_i16_le();
32920 Ok(__struct)
32921 }
32922 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32923 let mut __tmp = BytesMut::new(bytes);
32924 #[allow(clippy::absurd_extreme_comparisons)]
32925 #[allow(unused_comparisons)]
32926 if __tmp.remaining() < Self::ENCODED_LEN {
32927 panic!(
32928 "buffer is too small (need {} bytes, but got {})",
32929 Self::ENCODED_LEN,
32930 __tmp.remaining(),
32931 )
32932 }
32933 __tmp.put_u64_le(self.time_usec);
32934 __tmp.put_f32_le(self.line_length);
32935 __tmp.put_f32_le(self.speed);
32936 __tmp.put_f32_le(self.tension);
32937 __tmp.put_f32_le(self.voltage);
32938 __tmp.put_f32_le(self.current);
32939 __tmp.put_u32_le(self.status.bits());
32940 __tmp.put_i16_le(self.temperature);
32941 if matches!(version, MavlinkVersion::V2) {
32942 let len = __tmp.len();
32943 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32944 } else {
32945 __tmp.len()
32946 }
32947 }
32948}
32949#[doc = "id: 231"]
32950#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32951#[derive(Debug, Clone, PartialEq)]
32952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32954pub struct WIND_COV_DATA {
32955 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32956 pub time_usec: u64,
32957 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32958 pub wind_x: f32,
32959 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32960 pub wind_y: f32,
32961 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32962 pub wind_z: f32,
32963 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32964 pub var_horiz: f32,
32965 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32966 pub var_vert: f32,
32967 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32968 pub wind_alt: f32,
32969 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32970 pub horiz_accuracy: f32,
32971 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32972 pub vert_accuracy: f32,
32973}
32974impl WIND_COV_DATA {
32975 pub const ENCODED_LEN: usize = 40usize;
32976 pub const DEFAULT: Self = Self {
32977 time_usec: 0_u64,
32978 wind_x: 0.0_f32,
32979 wind_y: 0.0_f32,
32980 wind_z: 0.0_f32,
32981 var_horiz: 0.0_f32,
32982 var_vert: 0.0_f32,
32983 wind_alt: 0.0_f32,
32984 horiz_accuracy: 0.0_f32,
32985 vert_accuracy: 0.0_f32,
32986 };
32987 #[cfg(feature = "arbitrary")]
32988 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32989 use arbitrary::{Arbitrary, Unstructured};
32990 let mut buf = [0u8; 1024];
32991 rng.fill_bytes(&mut buf);
32992 let mut unstructured = Unstructured::new(&buf);
32993 Self::arbitrary(&mut unstructured).unwrap_or_default()
32994 }
32995}
32996impl Default for WIND_COV_DATA {
32997 fn default() -> Self {
32998 Self::DEFAULT.clone()
32999 }
33000}
33001impl MessageData for WIND_COV_DATA {
33002 type Message = MavMessage;
33003 const ID: u32 = 231u32;
33004 const NAME: &'static str = "WIND_COV";
33005 const EXTRA_CRC: u8 = 105u8;
33006 const ENCODED_LEN: usize = 40usize;
33007 fn deser(
33008 _version: MavlinkVersion,
33009 __input: &[u8],
33010 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33011 let avail_len = __input.len();
33012 let mut payload_buf = [0; Self::ENCODED_LEN];
33013 let mut buf = if avail_len < Self::ENCODED_LEN {
33014 payload_buf[0..avail_len].copy_from_slice(__input);
33015 Bytes::new(&payload_buf)
33016 } else {
33017 Bytes::new(__input)
33018 };
33019 let mut __struct = Self::default();
33020 __struct.time_usec = buf.get_u64_le();
33021 __struct.wind_x = buf.get_f32_le();
33022 __struct.wind_y = buf.get_f32_le();
33023 __struct.wind_z = buf.get_f32_le();
33024 __struct.var_horiz = buf.get_f32_le();
33025 __struct.var_vert = buf.get_f32_le();
33026 __struct.wind_alt = buf.get_f32_le();
33027 __struct.horiz_accuracy = buf.get_f32_le();
33028 __struct.vert_accuracy = buf.get_f32_le();
33029 Ok(__struct)
33030 }
33031 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
33032 let mut __tmp = BytesMut::new(bytes);
33033 #[allow(clippy::absurd_extreme_comparisons)]
33034 #[allow(unused_comparisons)]
33035 if __tmp.remaining() < Self::ENCODED_LEN {
33036 panic!(
33037 "buffer is too small (need {} bytes, but got {})",
33038 Self::ENCODED_LEN,
33039 __tmp.remaining(),
33040 )
33041 }
33042 __tmp.put_u64_le(self.time_usec);
33043 __tmp.put_f32_le(self.wind_x);
33044 __tmp.put_f32_le(self.wind_y);
33045 __tmp.put_f32_le(self.wind_z);
33046 __tmp.put_f32_le(self.var_horiz);
33047 __tmp.put_f32_le(self.var_vert);
33048 __tmp.put_f32_le(self.wind_alt);
33049 __tmp.put_f32_le(self.horiz_accuracy);
33050 __tmp.put_f32_le(self.vert_accuracy);
33051 if matches!(version, MavlinkVersion::V2) {
33052 let len = __tmp.len();
33053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
33054 } else {
33055 __tmp.len()
33056 }
33057 }
33058}
33059#[derive(Clone, PartialEq, Debug)]
33060#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33061#[cfg_attr(feature = "serde", serde(tag = "type"))]
33062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33063#[repr(u32)]
33064pub enum MavMessage {
33065 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
33066 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
33067 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
33068 AIS_VESSEL(AIS_VESSEL_DATA),
33069 ALTITUDE(ALTITUDE_DATA),
33070 ASLCTRL_DATA(ASLCTRL_DATA_DATA),
33071 ASLCTRL_DEBUG(ASLCTRL_DEBUG_DATA),
33072 ASLUAV_STATUS(ASLUAV_STATUS_DATA),
33073 ASL_OBCTRL(ASL_OBCTRL_DATA),
33074 ATTITUDE(ATTITUDE_DATA),
33075 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
33076 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
33077 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
33078 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
33079 AUTH_KEY(AUTH_KEY_DATA),
33080 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
33081 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
33082 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
33083 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
33084 BATTERY_INFO(BATTERY_INFO_DATA),
33085 BATTERY_STATUS(BATTERY_STATUS_DATA),
33086 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
33087 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
33088 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
33089 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
33090 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
33091 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
33092 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
33093 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
33094 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
33095 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
33096 CANFD_FRAME(CANFD_FRAME_DATA),
33097 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
33098 CAN_FRAME(CAN_FRAME_DATA),
33099 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
33100 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
33101 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
33102 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
33103 COLLISION(COLLISION_DATA),
33104 COMMAND_ACK(COMMAND_ACK_DATA),
33105 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
33106 COMMAND_INT(COMMAND_INT_DATA),
33107 COMMAND_INT_STAMPED(COMMAND_INT_STAMPED_DATA),
33108 COMMAND_LONG(COMMAND_LONG_DATA),
33109 COMMAND_LONG_STAMPED(COMMAND_LONG_STAMPED_DATA),
33110 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
33111 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
33112 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
33113 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
33114 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
33115 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
33116 CURRENT_MODE(CURRENT_MODE_DATA),
33117 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
33118 DATA_STREAM(DATA_STREAM_DATA),
33119 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
33120 DEBUG(DEBUG_DATA),
33121 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
33122 DEBUG_VECT(DEBUG_VECT_DATA),
33123 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
33124 EFI_STATUS(EFI_STATUS_DATA),
33125 EKF_EXT(EKF_EXT_DATA),
33126 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
33127 ESC_INFO(ESC_INFO_DATA),
33128 ESC_STATUS(ESC_STATUS_DATA),
33129 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
33130 EVENT(EVENT_DATA),
33131 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
33132 FENCE_STATUS(FENCE_STATUS_DATA),
33133 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
33134 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
33135 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
33136 FUEL_STATUS(FUEL_STATUS_DATA),
33137 FW_SOARING_DATA(FW_SOARING_DATA_DATA),
33138 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
33139 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
33140 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
33141 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
33142 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
33143 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
33144 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
33145 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
33146 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
33147 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
33148 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
33149 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
33150 GPS2_RAW(GPS2_RAW_DATA),
33151 GPS2_RTK(GPS2_RTK_DATA),
33152 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
33153 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
33154 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
33155 GPS_INPUT(GPS_INPUT_DATA),
33156 GPS_RAW_INT(GPS_RAW_INT_DATA),
33157 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
33158 GPS_RTK(GPS_RTK_DATA),
33159 GPS_STATUS(GPS_STATUS_DATA),
33160 GSM_LINK_STATUS(GSM_LINK_STATUS_DATA),
33161 HEARTBEAT(HEARTBEAT_DATA),
33162 HIGHRES_IMU(HIGHRES_IMU_DATA),
33163 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
33164 HIGH_LATENCY(HIGH_LATENCY_DATA),
33165 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
33166 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
33167 HIL_CONTROLS(HIL_CONTROLS_DATA),
33168 HIL_GPS(HIL_GPS_DATA),
33169 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
33170 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
33171 HIL_SENSOR(HIL_SENSOR_DATA),
33172 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
33173 HIL_STATE(HIL_STATE_DATA),
33174 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
33175 HOME_POSITION(HOME_POSITION_DATA),
33176 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
33177 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
33178 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
33179 LANDING_TARGET(LANDING_TARGET_DATA),
33180 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
33181 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
33182 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
33183 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
33184 LOGGING_ACK(LOGGING_ACK_DATA),
33185 LOGGING_DATA(LOGGING_DATA_DATA),
33186 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
33187 LOG_DATA(LOG_DATA_DATA),
33188 LOG_ENTRY(LOG_ENTRY_DATA),
33189 LOG_ERASE(LOG_ERASE_DATA),
33190 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
33191 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
33192 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
33193 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
33194 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
33195 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
33196 MEMORY_VECT(MEMORY_VECT_DATA),
33197 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
33198 MISSION_ACK(MISSION_ACK_DATA),
33199 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
33200 MISSION_COUNT(MISSION_COUNT_DATA),
33201 MISSION_CURRENT(MISSION_CURRENT_DATA),
33202 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
33203 MISSION_ITEM(MISSION_ITEM_DATA),
33204 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
33205 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
33206 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
33207 MISSION_REQUEST(MISSION_REQUEST_DATA),
33208 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33209 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33210 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33211 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33212 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33213 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33214 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33215 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33216 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33217 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33218 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33219 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33220 ODOMETRY(ODOMETRY_DATA),
33221 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33222 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33223 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33224 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33225 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33226 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33227 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33228 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33229 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33230 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33231 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33232 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33233 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33234 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33235 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33236 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33237 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33238 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33239 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33240 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33241 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33242 PARAM_SET(PARAM_SET_DATA),
33243 PARAM_VALUE(PARAM_VALUE_DATA),
33244 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33245 PING(PING_DATA),
33246 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33247 PLAY_TUNE(PLAY_TUNE_DATA),
33248 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33249 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33250 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33251 POWER_STATUS(POWER_STATUS_DATA),
33252 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33253 RADIO_STATUS(RADIO_STATUS_DATA),
33254 RAW_IMU(RAW_IMU_DATA),
33255 RAW_PRESSURE(RAW_PRESSURE_DATA),
33256 RAW_RPM(RAW_RPM_DATA),
33257 RC_CHANNELS(RC_CHANNELS_DATA),
33258 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33259 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33260 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33261 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33262 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33263 REQUEST_EVENT(REQUEST_EVENT_DATA),
33264 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33265 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33266 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33267 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33268 SATCOM_LINK_STATUS(SATCOM_LINK_STATUS_DATA),
33269 SCALED_IMU(SCALED_IMU_DATA),
33270 SCALED_IMU2(SCALED_IMU2_DATA),
33271 SCALED_IMU3(SCALED_IMU3_DATA),
33272 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33273 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33274 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33275 SENSORPOD_STATUS(SENSORPOD_STATUS_DATA),
33276 SENSOR_AIRFLOW_ANGLES(SENSOR_AIRFLOW_ANGLES_DATA),
33277 SENS_ATMOS(SENS_ATMOS_DATA),
33278 SENS_BATMON(SENS_BATMON_DATA),
33279 SENS_MPPT(SENS_MPPT_DATA),
33280 SENS_POWER(SENS_POWER_DATA),
33281 SENS_POWER_BOARD(SENS_POWER_BOARD_DATA),
33282 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33283 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33284 SETUP_SIGNING(SETUP_SIGNING_DATA),
33285 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33286 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33287 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33288 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33289 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33290 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33291 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33292 SET_MODE(SET_MODE_DATA),
33293 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33294 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33295 SIM_STATE(SIM_STATE_DATA),
33296 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33297 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33298 STATUSTEXT(STATUSTEXT_DATA),
33299 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33300 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33301 SYSTEM_TIME(SYSTEM_TIME_DATA),
33302 SYS_STATUS(SYS_STATUS_DATA),
33303 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33304 TERRAIN_DATA(TERRAIN_DATA_DATA),
33305 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33306 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33307 TIMESYNC(TIMESYNC_DATA),
33308 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33309 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33310 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33311 TUNNEL(TUNNEL_DATA),
33312 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33313 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33314 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33315 V2_EXTENSION(V2_EXTENSION_DATA),
33316 VFR_HUD(VFR_HUD_DATA),
33317 VIBRATION(VIBRATION_DATA),
33318 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33319 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33320 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33321 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33322 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33323 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33324 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33325 WINCH_STATUS(WINCH_STATUS_DATA),
33326 WIND_COV(WIND_COV_DATA),
33327}
33328impl MavMessage {
33329 pub const fn all_ids() -> &'static [u32] {
33330 &[
33331 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33332 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33333 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33334 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33335 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33336 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33337 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33338 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33339 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33340 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33341 148u32, 149u32, 162u32, 192u32, 223u32, 224u32, 225u32, 230u32, 231u32, 232u32, 233u32,
33342 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32,
33343 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32,
33344 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32,
33345 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32,
33346 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32,
33347 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32,
33348 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32,
33349 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32,
33350 436u32, 437u32, 440u32, 8002u32, 8003u32, 8004u32, 8005u32, 8006u32, 8007u32, 8008u32,
33351 8009u32, 8010u32, 8011u32, 8012u32, 8013u32, 8014u32, 8015u32, 8016u32, 9000u32,
33352 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32, 12915u32,
33353 12918u32, 12919u32, 12920u32,
33354 ]
33355 }
33356}
33357impl Message for MavMessage {
33358 fn parse(
33359 version: MavlinkVersion,
33360 id: u32,
33361 payload: &[u8],
33362 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33363 match id {
33364 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33365 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33366 .map(Self::ACTUATOR_CONTROL_TARGET)
33367 }
33368 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33369 .map(Self::ACTUATOR_OUTPUT_STATUS),
33370 ADSB_VEHICLE_DATA::ID => {
33371 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33372 }
33373 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33374 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33375 ASLCTRL_DATA_DATA::ID => {
33376 ASLCTRL_DATA_DATA::deser(version, payload).map(Self::ASLCTRL_DATA)
33377 }
33378 ASLCTRL_DEBUG_DATA::ID => {
33379 ASLCTRL_DEBUG_DATA::deser(version, payload).map(Self::ASLCTRL_DEBUG)
33380 }
33381 ASLUAV_STATUS_DATA::ID => {
33382 ASLUAV_STATUS_DATA::deser(version, payload).map(Self::ASLUAV_STATUS)
33383 }
33384 ASL_OBCTRL_DATA::ID => ASL_OBCTRL_DATA::deser(version, payload).map(Self::ASL_OBCTRL),
33385 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33386 ATTITUDE_QUATERNION_DATA::ID => {
33387 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33388 }
33389 ATTITUDE_QUATERNION_COV_DATA::ID => {
33390 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33391 .map(Self::ATTITUDE_QUATERNION_COV)
33392 }
33393 ATTITUDE_TARGET_DATA::ID => {
33394 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33395 }
33396 ATT_POS_MOCAP_DATA::ID => {
33397 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33398 }
33399 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33400 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33401 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33402 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33403 }
33404 AUTOPILOT_VERSION_DATA::ID => {
33405 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33406 }
33407 AVAILABLE_MODES_DATA::ID => {
33408 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33409 }
33410 AVAILABLE_MODES_MONITOR_DATA::ID => {
33411 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33412 .map(Self::AVAILABLE_MODES_MONITOR)
33413 }
33414 BATTERY_INFO_DATA::ID => {
33415 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33416 }
33417 BATTERY_STATUS_DATA::ID => {
33418 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33419 }
33420 BUTTON_CHANGE_DATA::ID => {
33421 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33422 }
33423 CAMERA_CAPTURE_STATUS_DATA::ID => {
33424 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33425 }
33426 CAMERA_FOV_STATUS_DATA::ID => {
33427 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33428 }
33429 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33430 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33431 }
33432 CAMERA_INFORMATION_DATA::ID => {
33433 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33434 }
33435 CAMERA_SETTINGS_DATA::ID => {
33436 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33437 }
33438 CAMERA_THERMAL_RANGE_DATA::ID => {
33439 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33440 }
33441 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33442 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33443 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33444 }
33445 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33446 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33447 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33448 }
33449 CAMERA_TRIGGER_DATA::ID => {
33450 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33451 }
33452 CANFD_FRAME_DATA::ID => {
33453 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33454 }
33455 CAN_FILTER_MODIFY_DATA::ID => {
33456 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33457 }
33458 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33459 CELLULAR_CONFIG_DATA::ID => {
33460 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33461 }
33462 CELLULAR_STATUS_DATA::ID => {
33463 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33464 }
33465 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33466 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33467 .map(Self::CHANGE_OPERATOR_CONTROL)
33468 }
33469 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33470 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33471 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33472 }
33473 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33474 COMMAND_ACK_DATA::ID => {
33475 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33476 }
33477 COMMAND_CANCEL_DATA::ID => {
33478 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33479 }
33480 COMMAND_INT_DATA::ID => {
33481 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33482 }
33483 COMMAND_INT_STAMPED_DATA::ID => {
33484 COMMAND_INT_STAMPED_DATA::deser(version, payload).map(Self::COMMAND_INT_STAMPED)
33485 }
33486 COMMAND_LONG_DATA::ID => {
33487 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33488 }
33489 COMMAND_LONG_STAMPED_DATA::ID => {
33490 COMMAND_LONG_STAMPED_DATA::deser(version, payload).map(Self::COMMAND_LONG_STAMPED)
33491 }
33492 COMPONENT_INFORMATION_DATA::ID => {
33493 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33494 }
33495 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33496 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33497 .map(Self::COMPONENT_INFORMATION_BASIC)
33498 }
33499 COMPONENT_METADATA_DATA::ID => {
33500 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33501 }
33502 CONTROL_SYSTEM_STATE_DATA::ID => {
33503 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33504 }
33505 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33506 .map(Self::CURRENT_EVENT_SEQUENCE),
33507 CURRENT_MODE_DATA::ID => {
33508 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33509 }
33510 DATA_STREAM_DATA::ID => {
33511 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33512 }
33513 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33514 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33515 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33516 }
33517 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33518 DEBUG_FLOAT_ARRAY_DATA::ID => {
33519 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33520 }
33521 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33522 DISTANCE_SENSOR_DATA::ID => {
33523 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33524 }
33525 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33526 EKF_EXT_DATA::ID => EKF_EXT_DATA::deser(version, payload).map(Self::EKF_EXT),
33527 ENCAPSULATED_DATA_DATA::ID => {
33528 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33529 }
33530 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33531 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33532 ESTIMATOR_STATUS_DATA::ID => {
33533 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33534 }
33535 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33536 EXTENDED_SYS_STATE_DATA::ID => {
33537 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33538 }
33539 FENCE_STATUS_DATA::ID => {
33540 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33541 }
33542 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33543 .map(Self::FILE_TRANSFER_PROTOCOL),
33544 FLIGHT_INFORMATION_DATA::ID => {
33545 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33546 }
33547 FOLLOW_TARGET_DATA::ID => {
33548 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33549 }
33550 FUEL_STATUS_DATA::ID => {
33551 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
33552 }
33553 FW_SOARING_DATA_DATA::ID => {
33554 FW_SOARING_DATA_DATA::deser(version, payload).map(Self::FW_SOARING_DATA)
33555 }
33556 GENERATOR_STATUS_DATA::ID => {
33557 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
33558 }
33559 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
33560 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
33561 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
33562 }
33563 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
33564 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
33565 .map(Self::GIMBAL_DEVICE_INFORMATION)
33566 }
33567 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
33568 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
33569 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
33570 }
33571 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
33572 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
33573 .map(Self::GIMBAL_MANAGER_INFORMATION)
33574 }
33575 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
33576 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
33577 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
33578 }
33579 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33580 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
33581 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
33582 }
33583 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
33584 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
33585 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
33586 }
33587 GIMBAL_MANAGER_STATUS_DATA::ID => {
33588 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
33589 }
33590 GLOBAL_POSITION_INT_DATA::ID => {
33591 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
33592 }
33593 GLOBAL_POSITION_INT_COV_DATA::ID => {
33594 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
33595 .map(Self::GLOBAL_POSITION_INT_COV)
33596 }
33597 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33598 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33599 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
33600 }
33601 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
33602 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
33603 GPS_GLOBAL_ORIGIN_DATA::ID => {
33604 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
33605 }
33606 GPS_INJECT_DATA_DATA::ID => {
33607 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
33608 }
33609 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
33610 GPS_RAW_INT_DATA::ID => {
33611 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
33612 }
33613 GPS_RTCM_DATA_DATA::ID => {
33614 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
33615 }
33616 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
33617 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
33618 GSM_LINK_STATUS_DATA::ID => {
33619 GSM_LINK_STATUS_DATA::deser(version, payload).map(Self::GSM_LINK_STATUS)
33620 }
33621 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
33622 HIGHRES_IMU_DATA::ID => {
33623 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
33624 }
33625 HIGH_LATENCY_DATA::ID => {
33626 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
33627 }
33628 HIGH_LATENCY2_DATA::ID => {
33629 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
33630 }
33631 HIL_ACTUATOR_CONTROLS_DATA::ID => {
33632 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
33633 }
33634 HIL_CONTROLS_DATA::ID => {
33635 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
33636 }
33637 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
33638 HIL_OPTICAL_FLOW_DATA::ID => {
33639 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
33640 }
33641 HIL_RC_INPUTS_RAW_DATA::ID => {
33642 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
33643 }
33644 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
33645 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
33646 HIL_STATE_QUATERNION_DATA::ID => {
33647 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
33648 }
33649 HOME_POSITION_DATA::ID => {
33650 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
33651 }
33652 HYGROMETER_SENSOR_DATA::ID => {
33653 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
33654 }
33655 ILLUMINATOR_STATUS_DATA::ID => {
33656 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
33657 }
33658 ISBD_LINK_STATUS_DATA::ID => {
33659 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
33660 }
33661 LANDING_TARGET_DATA::ID => {
33662 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
33663 }
33664 LINK_NODE_STATUS_DATA::ID => {
33665 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
33666 }
33667 LOCAL_POSITION_NED_DATA::ID => {
33668 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
33669 }
33670 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
33671 .map(Self::LOCAL_POSITION_NED_COV),
33672 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33673 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
33674 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
33675 }
33676 LOGGING_ACK_DATA::ID => {
33677 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
33678 }
33679 LOGGING_DATA_DATA::ID => {
33680 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
33681 }
33682 LOGGING_DATA_ACKED_DATA::ID => {
33683 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
33684 }
33685 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
33686 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
33687 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
33688 LOG_REQUEST_DATA_DATA::ID => {
33689 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33690 }
33691 LOG_REQUEST_END_DATA::ID => {
33692 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33693 }
33694 LOG_REQUEST_LIST_DATA::ID => {
33695 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33696 }
33697 MAG_CAL_REPORT_DATA::ID => {
33698 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33699 }
33700 MANUAL_CONTROL_DATA::ID => {
33701 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33702 }
33703 MANUAL_SETPOINT_DATA::ID => {
33704 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33705 }
33706 MEMORY_VECT_DATA::ID => {
33707 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33708 }
33709 MESSAGE_INTERVAL_DATA::ID => {
33710 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33711 }
33712 MISSION_ACK_DATA::ID => {
33713 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33714 }
33715 MISSION_CLEAR_ALL_DATA::ID => {
33716 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33717 }
33718 MISSION_COUNT_DATA::ID => {
33719 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33720 }
33721 MISSION_CURRENT_DATA::ID => {
33722 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33723 }
33724 MISSION_ITEM_DATA::ID => {
33725 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33726 }
33727 MISSION_ITEM_INT_DATA::ID => {
33728 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33729 }
33730 MISSION_ITEM_REACHED_DATA::ID => {
33731 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33732 }
33733 MISSION_REQUEST_DATA::ID => {
33734 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33735 }
33736 MISSION_REQUEST_INT_DATA::ID => {
33737 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33738 }
33739 MISSION_REQUEST_LIST_DATA::ID => {
33740 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33741 }
33742 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33743 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33744 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33745 }
33746 MISSION_SET_CURRENT_DATA::ID => {
33747 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33748 }
33749 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33750 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33751 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33752 }
33753 MOUNT_ORIENTATION_DATA::ID => {
33754 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33755 }
33756 NAMED_VALUE_FLOAT_DATA::ID => {
33757 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33758 }
33759 NAMED_VALUE_INT_DATA::ID => {
33760 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33761 }
33762 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33763 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33764 }
33765 OBSTACLE_DISTANCE_DATA::ID => {
33766 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33767 }
33768 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33769 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33770 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33771 .map(Self::ONBOARD_COMPUTER_STATUS)
33772 }
33773 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33774 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33775 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33776 }
33777 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33778 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33779 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33780 }
33781 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33782 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33783 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33784 .map(Self::OPEN_DRONE_ID_LOCATION),
33785 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33786 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33787 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33788 }
33789 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33790 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33791 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33792 }
33793 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33794 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33795 }
33796 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33797 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33798 }
33799 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33800 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33801 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33802 }
33803 OPTICAL_FLOW_DATA::ID => {
33804 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33805 }
33806 OPTICAL_FLOW_RAD_DATA::ID => {
33807 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33808 }
33809 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33810 .map(Self::ORBIT_EXECUTION_STATUS),
33811 PARAM_EXT_ACK_DATA::ID => {
33812 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33813 }
33814 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33815 .map(Self::PARAM_EXT_REQUEST_LIST),
33816 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33817 .map(Self::PARAM_EXT_REQUEST_READ),
33818 PARAM_EXT_SET_DATA::ID => {
33819 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33820 }
33821 PARAM_EXT_VALUE_DATA::ID => {
33822 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33823 }
33824 PARAM_MAP_RC_DATA::ID => {
33825 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33826 }
33827 PARAM_REQUEST_LIST_DATA::ID => {
33828 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33829 }
33830 PARAM_REQUEST_READ_DATA::ID => {
33831 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33832 }
33833 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33834 PARAM_VALUE_DATA::ID => {
33835 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
33836 }
33837 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
33838 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
33839 PLAY_TUNE_V2_DATA::ID => {
33840 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
33841 }
33842 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33843 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33844 .map(Self::POSITION_TARGET_GLOBAL_INT)
33845 }
33846 POSITION_TARGET_LOCAL_NED_DATA::ID => {
33847 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33848 .map(Self::POSITION_TARGET_LOCAL_NED)
33849 }
33850 POWER_STATUS_DATA::ID => {
33851 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
33852 }
33853 PROTOCOL_VERSION_DATA::ID => {
33854 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
33855 }
33856 RADIO_STATUS_DATA::ID => {
33857 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
33858 }
33859 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
33860 RAW_PRESSURE_DATA::ID => {
33861 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
33862 }
33863 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
33864 RC_CHANNELS_DATA::ID => {
33865 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
33866 }
33867 RC_CHANNELS_OVERRIDE_DATA::ID => {
33868 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
33869 }
33870 RC_CHANNELS_RAW_DATA::ID => {
33871 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
33872 }
33873 RC_CHANNELS_SCALED_DATA::ID => {
33874 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
33875 }
33876 REQUEST_DATA_STREAM_DATA::ID => {
33877 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
33878 }
33879 REQUEST_EVENT_DATA::ID => {
33880 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
33881 }
33882 RESOURCE_REQUEST_DATA::ID => {
33883 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
33884 }
33885 RESPONSE_EVENT_ERROR_DATA::ID => {
33886 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
33887 }
33888 SAFETY_ALLOWED_AREA_DATA::ID => {
33889 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
33890 }
33891 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
33892 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
33893 .map(Self::SAFETY_SET_ALLOWED_AREA)
33894 }
33895 SATCOM_LINK_STATUS_DATA::ID => {
33896 SATCOM_LINK_STATUS_DATA::deser(version, payload).map(Self::SATCOM_LINK_STATUS)
33897 }
33898 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
33899 SCALED_IMU2_DATA::ID => {
33900 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
33901 }
33902 SCALED_IMU3_DATA::ID => {
33903 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
33904 }
33905 SCALED_PRESSURE_DATA::ID => {
33906 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
33907 }
33908 SCALED_PRESSURE2_DATA::ID => {
33909 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
33910 }
33911 SCALED_PRESSURE3_DATA::ID => {
33912 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
33913 }
33914 SENSORPOD_STATUS_DATA::ID => {
33915 SENSORPOD_STATUS_DATA::deser(version, payload).map(Self::SENSORPOD_STATUS)
33916 }
33917 SENSOR_AIRFLOW_ANGLES_DATA::ID => {
33918 SENSOR_AIRFLOW_ANGLES_DATA::deser(version, payload).map(Self::SENSOR_AIRFLOW_ANGLES)
33919 }
33920 SENS_ATMOS_DATA::ID => SENS_ATMOS_DATA::deser(version, payload).map(Self::SENS_ATMOS),
33921 SENS_BATMON_DATA::ID => {
33922 SENS_BATMON_DATA::deser(version, payload).map(Self::SENS_BATMON)
33923 }
33924 SENS_MPPT_DATA::ID => SENS_MPPT_DATA::deser(version, payload).map(Self::SENS_MPPT),
33925 SENS_POWER_DATA::ID => SENS_POWER_DATA::deser(version, payload).map(Self::SENS_POWER),
33926 SENS_POWER_BOARD_DATA::ID => {
33927 SENS_POWER_BOARD_DATA::deser(version, payload).map(Self::SENS_POWER_BOARD)
33928 }
33929 SERIAL_CONTROL_DATA::ID => {
33930 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
33931 }
33932 SERVO_OUTPUT_RAW_DATA::ID => {
33933 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
33934 }
33935 SETUP_SIGNING_DATA::ID => {
33936 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
33937 }
33938 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
33939 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33940 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
33941 }
33942 SET_ATTITUDE_TARGET_DATA::ID => {
33943 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
33944 }
33945 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
33946 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
33947 }
33948 SET_HOME_POSITION_DATA::ID => {
33949 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
33950 }
33951 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
33952 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33953 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33954 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
33955 }
33956 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
33957 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33958 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
33959 }
33960 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
33961 SMART_BATTERY_INFO_DATA::ID => {
33962 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
33963 }
33964 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
33965 STORAGE_INFORMATION_DATA::ID => {
33966 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
33967 }
33968 SUPPORTED_TUNES_DATA::ID => {
33969 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
33970 }
33971 SYSTEM_TIME_DATA::ID => {
33972 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
33973 }
33974 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
33975 TERRAIN_CHECK_DATA::ID => {
33976 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
33977 }
33978 TERRAIN_DATA_DATA::ID => {
33979 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
33980 }
33981 TERRAIN_REPORT_DATA::ID => {
33982 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
33983 }
33984 TERRAIN_REQUEST_DATA::ID => {
33985 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
33986 }
33987 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
33988 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
33989 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
33990 .map(Self::TIME_ESTIMATE_TO_TARGET)
33991 }
33992 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33993 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
33994 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
33995 }
33996 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33997 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
33998 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
33999 }
34000 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
34001 UAVCAN_NODE_INFO_DATA::ID => {
34002 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
34003 }
34004 UAVCAN_NODE_STATUS_DATA::ID => {
34005 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
34006 }
34007 UTM_GLOBAL_POSITION_DATA::ID => {
34008 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
34009 }
34010 V2_EXTENSION_DATA::ID => {
34011 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
34012 }
34013 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
34014 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
34015 VICON_POSITION_ESTIMATE_DATA::ID => {
34016 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
34017 .map(Self::VICON_POSITION_ESTIMATE)
34018 }
34019 VIDEO_STREAM_INFORMATION_DATA::ID => {
34020 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
34021 .map(Self::VIDEO_STREAM_INFORMATION)
34022 }
34023 VIDEO_STREAM_STATUS_DATA::ID => {
34024 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
34025 }
34026 VISION_POSITION_ESTIMATE_DATA::ID => {
34027 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34028 .map(Self::VISION_POSITION_ESTIMATE)
34029 }
34030 VISION_SPEED_ESTIMATE_DATA::ID => {
34031 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
34032 }
34033 WHEEL_DISTANCE_DATA::ID => {
34034 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
34035 }
34036 WIFI_CONFIG_AP_DATA::ID => {
34037 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
34038 }
34039 WINCH_STATUS_DATA::ID => {
34040 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
34041 }
34042 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
34043 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
34044 }
34045 }
34046 fn message_name(&self) -> &'static str {
34047 match self {
34048 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
34049 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34050 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
34051 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
34052 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
34053 Self::ASLCTRL_DATA(..) => ASLCTRL_DATA_DATA::NAME,
34054 Self::ASLCTRL_DEBUG(..) => ASLCTRL_DEBUG_DATA::NAME,
34055 Self::ASLUAV_STATUS(..) => ASLUAV_STATUS_DATA::NAME,
34056 Self::ASL_OBCTRL(..) => ASL_OBCTRL_DATA::NAME,
34057 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
34058 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
34059 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
34060 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
34061 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
34062 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
34063 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34064 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
34065 }
34066 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
34067 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
34068 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
34069 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
34070 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
34071 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
34072 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
34073 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
34074 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
34075 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
34076 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
34077 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
34078 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34079 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34080 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
34081 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
34082 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
34083 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
34084 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
34085 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
34086 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
34087 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34088 Self::COLLISION(..) => COLLISION_DATA::NAME,
34089 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
34090 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
34091 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
34092 Self::COMMAND_INT_STAMPED(..) => COMMAND_INT_STAMPED_DATA::NAME,
34093 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
34094 Self::COMMAND_LONG_STAMPED(..) => COMMAND_LONG_STAMPED_DATA::NAME,
34095 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
34096 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
34097 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
34098 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
34099 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
34100 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
34101 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
34102 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34103 Self::DEBUG(..) => DEBUG_DATA::NAME,
34104 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
34105 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
34106 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
34107 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
34108 Self::EKF_EXT(..) => EKF_EXT_DATA::NAME,
34109 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
34110 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
34111 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
34112 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
34113 Self::EVENT(..) => EVENT_DATA::NAME,
34114 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
34115 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
34116 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
34117 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
34118 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
34119 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
34120 Self::FW_SOARING_DATA(..) => FW_SOARING_DATA_DATA::NAME,
34121 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
34122 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34123 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34124 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34125 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34126 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34127 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34128 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
34129 }
34130 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34131 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
34132 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
34133 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
34134 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34135 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
34136 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
34137 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
34138 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
34139 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
34140 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
34141 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
34142 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
34143 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
34144 Self::GSM_LINK_STATUS(..) => GSM_LINK_STATUS_DATA::NAME,
34145 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
34146 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
34147 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
34148 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
34149 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
34150 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
34151 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
34152 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
34153 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
34154 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
34155 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
34156 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
34157 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
34158 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
34159 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
34160 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
34161 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
34162 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
34163 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
34164 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
34165 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34166 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
34167 }
34168 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
34169 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
34170 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
34171 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
34172 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
34173 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
34174 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
34175 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
34176 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
34177 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
34178 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
34179 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
34180 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
34181 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
34182 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
34183 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
34184 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
34185 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
34186 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
34187 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
34188 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
34189 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
34190 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
34191 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
34192 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34193 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
34194 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34195 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
34196 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
34197 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
34198 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
34199 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
34200 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
34201 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
34202 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34203 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34204 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34205 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
34206 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34207 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34208 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34209 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34210 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34211 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
34212 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
34213 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
34214 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
34215 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
34216 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
34217 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
34218 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
34219 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
34220 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
34221 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
34222 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
34223 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
34224 Self::PING(..) => PING_DATA::NAME,
34225 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
34226 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
34227 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34228 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
34229 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
34230 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
34231 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
34232 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
34233 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
34234 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
34235 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
34236 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
34237 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
34238 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
34239 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
34240 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
34241 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
34242 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
34243 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
34244 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34245 Self::SATCOM_LINK_STATUS(..) => SATCOM_LINK_STATUS_DATA::NAME,
34246 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
34247 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
34248 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
34249 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
34250 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
34251 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
34252 Self::SENSORPOD_STATUS(..) => SENSORPOD_STATUS_DATA::NAME,
34253 Self::SENSOR_AIRFLOW_ANGLES(..) => SENSOR_AIRFLOW_ANGLES_DATA::NAME,
34254 Self::SENS_ATMOS(..) => SENS_ATMOS_DATA::NAME,
34255 Self::SENS_BATMON(..) => SENS_BATMON_DATA::NAME,
34256 Self::SENS_MPPT(..) => SENS_MPPT_DATA::NAME,
34257 Self::SENS_POWER(..) => SENS_POWER_DATA::NAME,
34258 Self::SENS_POWER_BOARD(..) => SENS_POWER_BOARD_DATA::NAME,
34259 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
34260 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
34261 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
34262 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34263 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
34264 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34265 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
34266 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
34267 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34268 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34269 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
34270 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
34271 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
34272 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
34273 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
34274 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
34275 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
34276 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
34277 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
34278 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
34279 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
34280 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
34281 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34282 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
34283 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
34284 }
34285 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34286 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
34287 }
34288 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
34289 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
34290 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
34291 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
34292 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
34293 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
34294 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
34295 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
34296 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
34297 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
34298 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
34299 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
34300 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34301 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34302 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34303 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34304 }
34305 }
34306 fn message_id(&self) -> u32 {
34307 match self {
34308 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34309 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34310 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34311 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34312 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34313 Self::ASLCTRL_DATA(..) => ASLCTRL_DATA_DATA::ID,
34314 Self::ASLCTRL_DEBUG(..) => ASLCTRL_DEBUG_DATA::ID,
34315 Self::ASLUAV_STATUS(..) => ASLUAV_STATUS_DATA::ID,
34316 Self::ASL_OBCTRL(..) => ASL_OBCTRL_DATA::ID,
34317 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34318 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34319 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34320 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34321 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34322 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34323 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34324 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34325 }
34326 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34327 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34328 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34329 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34330 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34331 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34332 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34333 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34334 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34335 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34336 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34337 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34338 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34339 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34340 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34341 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34342 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34343 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34344 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34345 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34346 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34347 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34348 Self::COLLISION(..) => COLLISION_DATA::ID,
34349 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34350 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34351 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34352 Self::COMMAND_INT_STAMPED(..) => COMMAND_INT_STAMPED_DATA::ID,
34353 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34354 Self::COMMAND_LONG_STAMPED(..) => COMMAND_LONG_STAMPED_DATA::ID,
34355 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34356 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34357 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34358 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34359 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34360 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34361 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34362 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34363 Self::DEBUG(..) => DEBUG_DATA::ID,
34364 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34365 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34366 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34367 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34368 Self::EKF_EXT(..) => EKF_EXT_DATA::ID,
34369 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34370 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34371 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34372 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34373 Self::EVENT(..) => EVENT_DATA::ID,
34374 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34375 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34376 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34377 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34378 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34379 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34380 Self::FW_SOARING_DATA(..) => FW_SOARING_DATA_DATA::ID,
34381 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34382 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34383 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34384 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34385 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34386 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34387 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34388 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34389 }
34390 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34391 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34392 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34393 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34394 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34395 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34396 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34397 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34398 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34399 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34400 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34401 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34402 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34403 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34404 Self::GSM_LINK_STATUS(..) => GSM_LINK_STATUS_DATA::ID,
34405 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34406 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34407 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34408 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34409 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34410 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34411 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34412 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34413 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34414 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34415 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34416 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34417 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34418 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34419 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34420 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34421 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34422 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34423 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34424 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34425 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34426 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34427 }
34428 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34429 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34430 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34431 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34432 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34433 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34434 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34435 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34436 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34437 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34438 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34439 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34440 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34441 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34442 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34443 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34444 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34445 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34446 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34447 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34448 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34449 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34450 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34451 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34452 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34453 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34454 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34455 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34456 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34457 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34458 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34459 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34460 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34461 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34462 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34463 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34464 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34465 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34466 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34467 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34468 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34469 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34470 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34471 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34472 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34473 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34474 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34475 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34476 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34477 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34478 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34479 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34480 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34481 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34482 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34483 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34484 Self::PING(..) => PING_DATA::ID,
34485 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34486 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34487 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34488 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34489 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34490 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34491 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34492 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34493 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34494 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34495 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34496 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34497 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34498 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34499 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34500 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34501 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34502 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34503 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34504 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34505 Self::SATCOM_LINK_STATUS(..) => SATCOM_LINK_STATUS_DATA::ID,
34506 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34507 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34508 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34509 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34510 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34511 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34512 Self::SENSORPOD_STATUS(..) => SENSORPOD_STATUS_DATA::ID,
34513 Self::SENSOR_AIRFLOW_ANGLES(..) => SENSOR_AIRFLOW_ANGLES_DATA::ID,
34514 Self::SENS_ATMOS(..) => SENS_ATMOS_DATA::ID,
34515 Self::SENS_BATMON(..) => SENS_BATMON_DATA::ID,
34516 Self::SENS_MPPT(..) => SENS_MPPT_DATA::ID,
34517 Self::SENS_POWER(..) => SENS_POWER_DATA::ID,
34518 Self::SENS_POWER_BOARD(..) => SENS_POWER_BOARD_DATA::ID,
34519 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34520 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34521 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34522 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34523 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34524 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34525 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34526 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34527 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34528 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34529 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34530 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34531 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34532 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34533 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34534 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34535 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34536 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34537 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34538 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34539 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34540 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34541 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34542 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34543 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34544 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34545 }
34546 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34547 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34548 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34549 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34550 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34551 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34552 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34553 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34554 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34555 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34556 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34557 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34558 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34559 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34560 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34561 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34562 }
34563 }
34564 fn message_id_from_name(name: &str) -> Option<u32> {
34565 match name {
34566 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34567 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34568 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34569 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34570 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34571 ASLCTRL_DATA_DATA::NAME => Some(ASLCTRL_DATA_DATA::ID),
34572 ASLCTRL_DEBUG_DATA::NAME => Some(ASLCTRL_DEBUG_DATA::ID),
34573 ASLUAV_STATUS_DATA::NAME => Some(ASLUAV_STATUS_DATA::ID),
34574 ASL_OBCTRL_DATA::NAME => Some(ASL_OBCTRL_DATA::ID),
34575 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34576 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34577 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34578 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34579 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34580 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34581 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34582 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34583 }
34584 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34585 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34586 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34587 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
34588 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
34589 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
34590 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
34591 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
34592 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
34593 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
34594 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
34595 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
34596 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
34597 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
34598 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
34599 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
34600 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
34601 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
34602 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
34603 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
34604 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
34605 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34606 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34607 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34608 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34609 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34610 COMMAND_INT_STAMPED_DATA::NAME => Some(COMMAND_INT_STAMPED_DATA::ID),
34611 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34612 COMMAND_LONG_STAMPED_DATA::NAME => Some(COMMAND_LONG_STAMPED_DATA::ID),
34613 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34614 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34615 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34616 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34617 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34618 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34619 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34620 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34621 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34622 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34623 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34624 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34625 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
34626 EKF_EXT_DATA::NAME => Some(EKF_EXT_DATA::ID),
34627 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
34628 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
34629 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
34630 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
34631 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
34632 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
34633 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
34634 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
34635 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
34636 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
34637 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
34638 FW_SOARING_DATA_DATA::NAME => Some(FW_SOARING_DATA_DATA::ID),
34639 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
34640 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
34641 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
34642 }
34643 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
34644 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
34645 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
34646 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
34647 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
34648 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
34649 }
34650 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
34651 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
34652 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
34653 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
34654 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
34655 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
34656 }
34657 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
34658 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
34659 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
34660 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
34661 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
34662 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
34663 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
34664 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
34665 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
34666 GSM_LINK_STATUS_DATA::NAME => Some(GSM_LINK_STATUS_DATA::ID),
34667 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
34668 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
34669 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
34670 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
34671 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
34672 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
34673 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
34674 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
34675 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
34676 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
34677 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
34678 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
34679 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
34680 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
34681 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
34682 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
34683 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
34684 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
34685 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
34686 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
34687 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
34688 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
34689 }
34690 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
34691 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
34692 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
34693 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
34694 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
34695 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
34696 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
34697 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
34698 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
34699 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
34700 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
34701 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
34702 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
34703 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
34704 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
34705 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
34706 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
34707 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
34708 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
34709 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
34710 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
34711 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
34712 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
34713 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
34714 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
34715 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
34716 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
34717 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
34718 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
34719 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
34720 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
34721 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
34722 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
34723 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
34724 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
34725 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
34726 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
34727 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
34728 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
34729 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
34730 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
34731 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
34732 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
34733 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
34734 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
34735 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
34736 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
34737 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
34738 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34739 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34740 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34741 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34742 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34743 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34744 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34745 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34746 PING_DATA::NAME => Some(PING_DATA::ID),
34747 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34748 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34749 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34750 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34751 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34752 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34753 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34754 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34755 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34756 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34757 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34758 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34759 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34760 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34761 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34762 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34763 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34764 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34765 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34766 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34767 SATCOM_LINK_STATUS_DATA::NAME => Some(SATCOM_LINK_STATUS_DATA::ID),
34768 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34769 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34770 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34771 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34772 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34773 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34774 SENSORPOD_STATUS_DATA::NAME => Some(SENSORPOD_STATUS_DATA::ID),
34775 SENSOR_AIRFLOW_ANGLES_DATA::NAME => Some(SENSOR_AIRFLOW_ANGLES_DATA::ID),
34776 SENS_ATMOS_DATA::NAME => Some(SENS_ATMOS_DATA::ID),
34777 SENS_BATMON_DATA::NAME => Some(SENS_BATMON_DATA::ID),
34778 SENS_MPPT_DATA::NAME => Some(SENS_MPPT_DATA::ID),
34779 SENS_POWER_DATA::NAME => Some(SENS_POWER_DATA::ID),
34780 SENS_POWER_BOARD_DATA::NAME => Some(SENS_POWER_BOARD_DATA::ID),
34781 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34782 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34783 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34784 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34785 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34786 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34787 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34788 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34789 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34790 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34791 }
34792 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34793 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34794 }
34795 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34796 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34797 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34798 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34799 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34800 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34801 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34802 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34803 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34804 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34805 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34806 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34807 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34808 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34809 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34810 }
34811 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34812 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34813 }
34814 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34815 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34816 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34817 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34818 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34819 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34820 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34821 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34822 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34823 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34824 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34825 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34826 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34827 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34828 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34829 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34830 _ => None,
34831 }
34832 }
34833 fn default_message_from_id(id: u32) -> Option<Self> {
34834 match id {
34835 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34836 ACTUATOR_CONTROL_TARGET_DATA::default(),
34837 )),
34838 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34839 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34840 )),
34841 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34842 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34843 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34844 ASLCTRL_DATA_DATA::ID => Some(Self::ASLCTRL_DATA(ASLCTRL_DATA_DATA::default())),
34845 ASLCTRL_DEBUG_DATA::ID => Some(Self::ASLCTRL_DEBUG(ASLCTRL_DEBUG_DATA::default())),
34846 ASLUAV_STATUS_DATA::ID => Some(Self::ASLUAV_STATUS(ASLUAV_STATUS_DATA::default())),
34847 ASL_OBCTRL_DATA::ID => Some(Self::ASL_OBCTRL(ASL_OBCTRL_DATA::default())),
34848 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34849 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34850 ATTITUDE_QUATERNION_DATA::default(),
34851 )),
34852 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34853 ATTITUDE_QUATERNION_COV_DATA::default(),
34854 )),
34855 ATTITUDE_TARGET_DATA::ID => {
34856 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34857 }
34858 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34859 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34860 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34861 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34862 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34863 ))
34864 }
34865 AUTOPILOT_VERSION_DATA::ID => {
34866 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34867 }
34868 AVAILABLE_MODES_DATA::ID => {
34869 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34870 }
34871 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34872 AVAILABLE_MODES_MONITOR_DATA::default(),
34873 )),
34874 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34875 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34876 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34877 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34878 CAMERA_CAPTURE_STATUS_DATA::default(),
34879 )),
34880 CAMERA_FOV_STATUS_DATA::ID => {
34881 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34882 }
34883 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34884 CAMERA_IMAGE_CAPTURED_DATA::default(),
34885 )),
34886 CAMERA_INFORMATION_DATA::ID => {
34887 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
34888 }
34889 CAMERA_SETTINGS_DATA::ID => {
34890 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
34891 }
34892 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34893 CAMERA_THERMAL_RANGE_DATA::default(),
34894 )),
34895 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34896 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
34897 )),
34898 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34899 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
34900 )),
34901 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
34902 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
34903 CAN_FILTER_MODIFY_DATA::ID => {
34904 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
34905 }
34906 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
34907 CELLULAR_CONFIG_DATA::ID => {
34908 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
34909 }
34910 CELLULAR_STATUS_DATA::ID => {
34911 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
34912 }
34913 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34914 CHANGE_OPERATOR_CONTROL_DATA::default(),
34915 )),
34916 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34917 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
34918 )),
34919 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
34920 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
34921 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
34922 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
34923 COMMAND_INT_STAMPED_DATA::ID => Some(Self::COMMAND_INT_STAMPED(
34924 COMMAND_INT_STAMPED_DATA::default(),
34925 )),
34926 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
34927 COMMAND_LONG_STAMPED_DATA::ID => Some(Self::COMMAND_LONG_STAMPED(
34928 COMMAND_LONG_STAMPED_DATA::default(),
34929 )),
34930 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34931 COMPONENT_INFORMATION_DATA::default(),
34932 )),
34933 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34934 COMPONENT_INFORMATION_BASIC_DATA::default(),
34935 )),
34936 COMPONENT_METADATA_DATA::ID => {
34937 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
34938 }
34939 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34940 CONTROL_SYSTEM_STATE_DATA::default(),
34941 )),
34942 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34943 CURRENT_EVENT_SEQUENCE_DATA::default(),
34944 )),
34945 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
34946 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
34947 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34948 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
34949 )),
34950 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
34951 DEBUG_FLOAT_ARRAY_DATA::ID => {
34952 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
34953 }
34954 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
34955 DISTANCE_SENSOR_DATA::ID => {
34956 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
34957 }
34958 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
34959 EKF_EXT_DATA::ID => Some(Self::EKF_EXT(EKF_EXT_DATA::default())),
34960 ENCAPSULATED_DATA_DATA::ID => {
34961 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
34962 }
34963 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
34964 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
34965 ESTIMATOR_STATUS_DATA::ID => {
34966 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
34967 }
34968 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
34969 EXTENDED_SYS_STATE_DATA::ID => {
34970 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
34971 }
34972 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
34973 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34974 FILE_TRANSFER_PROTOCOL_DATA::default(),
34975 )),
34976 FLIGHT_INFORMATION_DATA::ID => {
34977 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
34978 }
34979 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
34980 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
34981 FW_SOARING_DATA_DATA::ID => {
34982 Some(Self::FW_SOARING_DATA(FW_SOARING_DATA_DATA::default()))
34983 }
34984 GENERATOR_STATUS_DATA::ID => {
34985 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
34986 }
34987 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34988 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
34989 )),
34990 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34991 GIMBAL_DEVICE_INFORMATION_DATA::default(),
34992 )),
34993 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34994 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
34995 )),
34996 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34997 GIMBAL_MANAGER_INFORMATION_DATA::default(),
34998 )),
34999 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35000 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
35001 )),
35002 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35003 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35004 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
35005 ))
35006 }
35007 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35008 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
35009 )),
35010 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35011 GIMBAL_MANAGER_STATUS_DATA::default(),
35012 )),
35013 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35014 GLOBAL_POSITION_INT_DATA::default(),
35015 )),
35016 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35017 GLOBAL_POSITION_INT_COV_DATA::default(),
35018 )),
35019 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35020 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35021 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
35022 ))
35023 }
35024 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
35025 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
35026 GPS_GLOBAL_ORIGIN_DATA::ID => {
35027 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
35028 }
35029 GPS_INJECT_DATA_DATA::ID => {
35030 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
35031 }
35032 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
35033 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
35034 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
35035 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
35036 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
35037 GSM_LINK_STATUS_DATA::ID => {
35038 Some(Self::GSM_LINK_STATUS(GSM_LINK_STATUS_DATA::default()))
35039 }
35040 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
35041 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
35042 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
35043 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
35044 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35045 HIL_ACTUATOR_CONTROLS_DATA::default(),
35046 )),
35047 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
35048 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
35049 HIL_OPTICAL_FLOW_DATA::ID => {
35050 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
35051 }
35052 HIL_RC_INPUTS_RAW_DATA::ID => {
35053 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
35054 }
35055 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
35056 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
35057 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35058 HIL_STATE_QUATERNION_DATA::default(),
35059 )),
35060 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
35061 HYGROMETER_SENSOR_DATA::ID => {
35062 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
35063 }
35064 ILLUMINATOR_STATUS_DATA::ID => {
35065 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
35066 }
35067 ISBD_LINK_STATUS_DATA::ID => {
35068 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
35069 }
35070 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
35071 LINK_NODE_STATUS_DATA::ID => {
35072 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
35073 }
35074 LOCAL_POSITION_NED_DATA::ID => {
35075 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
35076 }
35077 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35078 LOCAL_POSITION_NED_COV_DATA::default(),
35079 )),
35080 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35081 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35082 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
35083 ))
35084 }
35085 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
35086 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
35087 LOGGING_DATA_ACKED_DATA::ID => {
35088 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
35089 }
35090 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
35091 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
35092 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
35093 LOG_REQUEST_DATA_DATA::ID => {
35094 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
35095 }
35096 LOG_REQUEST_END_DATA::ID => {
35097 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
35098 }
35099 LOG_REQUEST_LIST_DATA::ID => {
35100 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
35101 }
35102 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
35103 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
35104 MANUAL_SETPOINT_DATA::ID => {
35105 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
35106 }
35107 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
35108 MESSAGE_INTERVAL_DATA::ID => {
35109 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
35110 }
35111 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
35112 MISSION_CLEAR_ALL_DATA::ID => {
35113 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
35114 }
35115 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
35116 MISSION_CURRENT_DATA::ID => {
35117 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
35118 }
35119 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
35120 MISSION_ITEM_INT_DATA::ID => {
35121 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
35122 }
35123 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35124 MISSION_ITEM_REACHED_DATA::default(),
35125 )),
35126 MISSION_REQUEST_DATA::ID => {
35127 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
35128 }
35129 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35130 MISSION_REQUEST_INT_DATA::default(),
35131 )),
35132 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35133 MISSION_REQUEST_LIST_DATA::default(),
35134 )),
35135 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35136 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
35137 )),
35138 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35139 MISSION_SET_CURRENT_DATA::default(),
35140 )),
35141 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35142 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
35143 )),
35144 MOUNT_ORIENTATION_DATA::ID => {
35145 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
35146 }
35147 NAMED_VALUE_FLOAT_DATA::ID => {
35148 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
35149 }
35150 NAMED_VALUE_INT_DATA::ID => {
35151 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
35152 }
35153 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35154 NAV_CONTROLLER_OUTPUT_DATA::default(),
35155 )),
35156 OBSTACLE_DISTANCE_DATA::ID => {
35157 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
35158 }
35159 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
35160 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35161 ONBOARD_COMPUTER_STATUS_DATA::default(),
35162 )),
35163 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35164 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
35165 )),
35166 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35167 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
35168 )),
35169 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35170 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
35171 )),
35172 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35173 OPEN_DRONE_ID_LOCATION_DATA::default(),
35174 )),
35175 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35176 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
35177 )),
35178 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35179 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
35180 )),
35181 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35182 OPEN_DRONE_ID_SELF_ID_DATA::default(),
35183 )),
35184 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35185 OPEN_DRONE_ID_SYSTEM_DATA::default(),
35186 )),
35187 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35188 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
35189 )),
35190 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
35191 OPTICAL_FLOW_RAD_DATA::ID => {
35192 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
35193 }
35194 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35195 ORBIT_EXECUTION_STATUS_DATA::default(),
35196 )),
35197 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
35198 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35199 PARAM_EXT_REQUEST_LIST_DATA::default(),
35200 )),
35201 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35202 PARAM_EXT_REQUEST_READ_DATA::default(),
35203 )),
35204 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
35205 PARAM_EXT_VALUE_DATA::ID => {
35206 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
35207 }
35208 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
35209 PARAM_REQUEST_LIST_DATA::ID => {
35210 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
35211 }
35212 PARAM_REQUEST_READ_DATA::ID => {
35213 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
35214 }
35215 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
35216 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
35217 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
35218 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
35219 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
35220 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35221 POSITION_TARGET_GLOBAL_INT_DATA::default(),
35222 )),
35223 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35224 POSITION_TARGET_LOCAL_NED_DATA::default(),
35225 )),
35226 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
35227 PROTOCOL_VERSION_DATA::ID => {
35228 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
35229 }
35230 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
35231 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
35232 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
35233 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
35234 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
35235 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35236 RC_CHANNELS_OVERRIDE_DATA::default(),
35237 )),
35238 RC_CHANNELS_RAW_DATA::ID => {
35239 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
35240 }
35241 RC_CHANNELS_SCALED_DATA::ID => {
35242 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
35243 }
35244 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35245 REQUEST_DATA_STREAM_DATA::default(),
35246 )),
35247 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
35248 RESOURCE_REQUEST_DATA::ID => {
35249 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
35250 }
35251 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35252 RESPONSE_EVENT_ERROR_DATA::default(),
35253 )),
35254 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35255 SAFETY_ALLOWED_AREA_DATA::default(),
35256 )),
35257 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35258 SAFETY_SET_ALLOWED_AREA_DATA::default(),
35259 )),
35260 SATCOM_LINK_STATUS_DATA::ID => {
35261 Some(Self::SATCOM_LINK_STATUS(SATCOM_LINK_STATUS_DATA::default()))
35262 }
35263 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
35264 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
35265 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
35266 SCALED_PRESSURE_DATA::ID => {
35267 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
35268 }
35269 SCALED_PRESSURE2_DATA::ID => {
35270 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
35271 }
35272 SCALED_PRESSURE3_DATA::ID => {
35273 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
35274 }
35275 SENSORPOD_STATUS_DATA::ID => {
35276 Some(Self::SENSORPOD_STATUS(SENSORPOD_STATUS_DATA::default()))
35277 }
35278 SENSOR_AIRFLOW_ANGLES_DATA::ID => Some(Self::SENSOR_AIRFLOW_ANGLES(
35279 SENSOR_AIRFLOW_ANGLES_DATA::default(),
35280 )),
35281 SENS_ATMOS_DATA::ID => Some(Self::SENS_ATMOS(SENS_ATMOS_DATA::default())),
35282 SENS_BATMON_DATA::ID => Some(Self::SENS_BATMON(SENS_BATMON_DATA::default())),
35283 SENS_MPPT_DATA::ID => Some(Self::SENS_MPPT(SENS_MPPT_DATA::default())),
35284 SENS_POWER_DATA::ID => Some(Self::SENS_POWER(SENS_POWER_DATA::default())),
35285 SENS_POWER_BOARD_DATA::ID => {
35286 Some(Self::SENS_POWER_BOARD(SENS_POWER_BOARD_DATA::default()))
35287 }
35288 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
35289 SERVO_OUTPUT_RAW_DATA::ID => {
35290 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
35291 }
35292 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
35293 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35294 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
35295 )),
35296 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35297 SET_ATTITUDE_TARGET_DATA::default(),
35298 )),
35299 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35300 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
35301 )),
35302 SET_HOME_POSITION_DATA::ID => {
35303 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
35304 }
35305 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
35306 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35307 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
35308 )),
35309 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35310 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
35311 )),
35312 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
35313 SMART_BATTERY_INFO_DATA::ID => {
35314 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
35315 }
35316 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
35317 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35318 STORAGE_INFORMATION_DATA::default(),
35319 )),
35320 SUPPORTED_TUNES_DATA::ID => {
35321 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
35322 }
35323 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
35324 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
35325 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
35326 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
35327 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
35328 TERRAIN_REQUEST_DATA::ID => {
35329 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
35330 }
35331 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
35332 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35333 TIME_ESTIMATE_TO_TARGET_DATA::default(),
35334 )),
35335 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35336 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35337 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
35338 ))
35339 }
35340 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35341 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35342 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35343 ))
35344 }
35345 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35346 UAVCAN_NODE_INFO_DATA::ID => {
35347 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
35348 }
35349 UAVCAN_NODE_STATUS_DATA::ID => {
35350 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35351 }
35352 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35353 UTM_GLOBAL_POSITION_DATA::default(),
35354 )),
35355 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35356 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
35357 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35358 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35359 VICON_POSITION_ESTIMATE_DATA::default(),
35360 )),
35361 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35362 VIDEO_STREAM_INFORMATION_DATA::default(),
35363 )),
35364 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35365 VIDEO_STREAM_STATUS_DATA::default(),
35366 )),
35367 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35368 VISION_POSITION_ESTIMATE_DATA::default(),
35369 )),
35370 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35371 VISION_SPEED_ESTIMATE_DATA::default(),
35372 )),
35373 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
35374 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
35375 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
35376 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
35377 _ => None,
35378 }
35379 }
35380 #[cfg(feature = "arbitrary")]
35381 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35382 match id {
35383 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35384 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35385 )),
35386 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35387 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35388 )),
35389 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35390 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35391 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35392 ASLCTRL_DATA_DATA::ID => Some(Self::ASLCTRL_DATA(ASLCTRL_DATA_DATA::random(rng))),
35393 ASLCTRL_DEBUG_DATA::ID => Some(Self::ASLCTRL_DEBUG(ASLCTRL_DEBUG_DATA::random(rng))),
35394 ASLUAV_STATUS_DATA::ID => Some(Self::ASLUAV_STATUS(ASLUAV_STATUS_DATA::random(rng))),
35395 ASL_OBCTRL_DATA::ID => Some(Self::ASL_OBCTRL(ASL_OBCTRL_DATA::random(rng))),
35396 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35397 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35398 ATTITUDE_QUATERNION_DATA::random(rng),
35399 )),
35400 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35401 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35402 )),
35403 ATTITUDE_TARGET_DATA::ID => {
35404 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35405 }
35406 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35407 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35408 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35409 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35410 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35411 ))
35412 }
35413 AUTOPILOT_VERSION_DATA::ID => {
35414 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35415 }
35416 AVAILABLE_MODES_DATA::ID => {
35417 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35418 }
35419 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35420 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35421 )),
35422 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35423 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35424 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35425 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35426 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35427 )),
35428 CAMERA_FOV_STATUS_DATA::ID => {
35429 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35430 }
35431 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35432 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35433 )),
35434 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35435 CAMERA_INFORMATION_DATA::random(rng),
35436 )),
35437 CAMERA_SETTINGS_DATA::ID => {
35438 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35439 }
35440 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35441 CAMERA_THERMAL_RANGE_DATA::random(rng),
35442 )),
35443 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35444 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35445 )),
35446 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35447 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35448 )),
35449 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35450 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35451 CAN_FILTER_MODIFY_DATA::ID => {
35452 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35453 }
35454 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35455 CELLULAR_CONFIG_DATA::ID => {
35456 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35457 }
35458 CELLULAR_STATUS_DATA::ID => {
35459 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35460 }
35461 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35462 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35463 )),
35464 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35465 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35466 )),
35467 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35468 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35469 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35470 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35471 COMMAND_INT_STAMPED_DATA::ID => Some(Self::COMMAND_INT_STAMPED(
35472 COMMAND_INT_STAMPED_DATA::random(rng),
35473 )),
35474 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35475 COMMAND_LONG_STAMPED_DATA::ID => Some(Self::COMMAND_LONG_STAMPED(
35476 COMMAND_LONG_STAMPED_DATA::random(rng),
35477 )),
35478 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35479 COMPONENT_INFORMATION_DATA::random(rng),
35480 )),
35481 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35482 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35483 )),
35484 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35485 COMPONENT_METADATA_DATA::random(rng),
35486 )),
35487 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35488 CONTROL_SYSTEM_STATE_DATA::random(rng),
35489 )),
35490 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35491 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35492 )),
35493 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35494 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35495 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35496 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35497 )),
35498 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35499 DEBUG_FLOAT_ARRAY_DATA::ID => {
35500 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35501 }
35502 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35503 DISTANCE_SENSOR_DATA::ID => {
35504 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35505 }
35506 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35507 EKF_EXT_DATA::ID => Some(Self::EKF_EXT(EKF_EXT_DATA::random(rng))),
35508 ENCAPSULATED_DATA_DATA::ID => {
35509 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35510 }
35511 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35512 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35513 ESTIMATOR_STATUS_DATA::ID => {
35514 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35515 }
35516 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35517 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35518 EXTENDED_SYS_STATE_DATA::random(rng),
35519 )),
35520 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35521 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35522 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35523 )),
35524 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35525 FLIGHT_INFORMATION_DATA::random(rng),
35526 )),
35527 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35528 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35529 FW_SOARING_DATA_DATA::ID => {
35530 Some(Self::FW_SOARING_DATA(FW_SOARING_DATA_DATA::random(rng)))
35531 }
35532 GENERATOR_STATUS_DATA::ID => {
35533 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35534 }
35535 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35536 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35537 )),
35538 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35539 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35540 )),
35541 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35542 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35543 )),
35544 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35545 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35546 )),
35547 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35548 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35549 )),
35550 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35551 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35552 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35553 ))
35554 }
35555 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35556 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35557 )),
35558 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35559 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35560 )),
35561 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35562 GLOBAL_POSITION_INT_DATA::random(rng),
35563 )),
35564 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35565 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35566 )),
35567 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35568 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35569 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35570 ))
35571 }
35572 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35573 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35574 GPS_GLOBAL_ORIGIN_DATA::ID => {
35575 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35576 }
35577 GPS_INJECT_DATA_DATA::ID => {
35578 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35579 }
35580 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35581 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35582 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35583 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35584 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35585 GSM_LINK_STATUS_DATA::ID => {
35586 Some(Self::GSM_LINK_STATUS(GSM_LINK_STATUS_DATA::random(rng)))
35587 }
35588 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35589 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35590 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35591 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35592 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35593 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35594 )),
35595 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35596 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35597 HIL_OPTICAL_FLOW_DATA::ID => {
35598 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35599 }
35600 HIL_RC_INPUTS_RAW_DATA::ID => {
35601 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35602 }
35603 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35604 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35605 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35606 HIL_STATE_QUATERNION_DATA::random(rng),
35607 )),
35608 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35609 HYGROMETER_SENSOR_DATA::ID => {
35610 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35611 }
35612 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35613 ILLUMINATOR_STATUS_DATA::random(rng),
35614 )),
35615 ISBD_LINK_STATUS_DATA::ID => {
35616 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35617 }
35618 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35619 LINK_NODE_STATUS_DATA::ID => {
35620 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35621 }
35622 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35623 LOCAL_POSITION_NED_DATA::random(rng),
35624 )),
35625 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35626 LOCAL_POSITION_NED_COV_DATA::random(rng),
35627 )),
35628 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35629 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35630 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35631 ))
35632 }
35633 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35634 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35635 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35636 LOGGING_DATA_ACKED_DATA::random(rng),
35637 )),
35638 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35639 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35640 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35641 LOG_REQUEST_DATA_DATA::ID => {
35642 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35643 }
35644 LOG_REQUEST_END_DATA::ID => {
35645 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35646 }
35647 LOG_REQUEST_LIST_DATA::ID => {
35648 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35649 }
35650 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35651 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35652 MANUAL_SETPOINT_DATA::ID => {
35653 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35654 }
35655 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35656 MESSAGE_INTERVAL_DATA::ID => {
35657 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35658 }
35659 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35660 MISSION_CLEAR_ALL_DATA::ID => {
35661 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35662 }
35663 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35664 MISSION_CURRENT_DATA::ID => {
35665 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35666 }
35667 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35668 MISSION_ITEM_INT_DATA::ID => {
35669 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35670 }
35671 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35672 MISSION_ITEM_REACHED_DATA::random(rng),
35673 )),
35674 MISSION_REQUEST_DATA::ID => {
35675 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
35676 }
35677 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35678 MISSION_REQUEST_INT_DATA::random(rng),
35679 )),
35680 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35681 MISSION_REQUEST_LIST_DATA::random(rng),
35682 )),
35683 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35684 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
35685 )),
35686 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35687 MISSION_SET_CURRENT_DATA::random(rng),
35688 )),
35689 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35690 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
35691 )),
35692 MOUNT_ORIENTATION_DATA::ID => {
35693 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
35694 }
35695 NAMED_VALUE_FLOAT_DATA::ID => {
35696 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
35697 }
35698 NAMED_VALUE_INT_DATA::ID => {
35699 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
35700 }
35701 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35702 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
35703 )),
35704 OBSTACLE_DISTANCE_DATA::ID => {
35705 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
35706 }
35707 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
35708 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35709 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
35710 )),
35711 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35712 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
35713 )),
35714 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35715 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
35716 )),
35717 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35718 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
35719 )),
35720 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35721 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
35722 )),
35723 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35724 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
35725 )),
35726 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35727 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
35728 )),
35729 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35730 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
35731 )),
35732 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35733 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
35734 )),
35735 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35736 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
35737 )),
35738 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
35739 OPTICAL_FLOW_RAD_DATA::ID => {
35740 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
35741 }
35742 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35743 ORBIT_EXECUTION_STATUS_DATA::random(rng),
35744 )),
35745 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
35746 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35747 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
35748 )),
35749 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35750 PARAM_EXT_REQUEST_READ_DATA::random(rng),
35751 )),
35752 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
35753 PARAM_EXT_VALUE_DATA::ID => {
35754 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
35755 }
35756 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
35757 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
35758 PARAM_REQUEST_LIST_DATA::random(rng),
35759 )),
35760 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
35761 PARAM_REQUEST_READ_DATA::random(rng),
35762 )),
35763 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
35764 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
35765 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
35766 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
35767 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
35768 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35769 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35770 )),
35771 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35772 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35773 )),
35774 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
35775 PROTOCOL_VERSION_DATA::ID => {
35776 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35777 }
35778 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35779 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35780 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35781 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35782 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35783 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35784 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35785 )),
35786 RC_CHANNELS_RAW_DATA::ID => {
35787 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35788 }
35789 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35790 RC_CHANNELS_SCALED_DATA::random(rng),
35791 )),
35792 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35793 REQUEST_DATA_STREAM_DATA::random(rng),
35794 )),
35795 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35796 RESOURCE_REQUEST_DATA::ID => {
35797 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35798 }
35799 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35800 RESPONSE_EVENT_ERROR_DATA::random(rng),
35801 )),
35802 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35803 SAFETY_ALLOWED_AREA_DATA::random(rng),
35804 )),
35805 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35806 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35807 )),
35808 SATCOM_LINK_STATUS_DATA::ID => Some(Self::SATCOM_LINK_STATUS(
35809 SATCOM_LINK_STATUS_DATA::random(rng),
35810 )),
35811 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35812 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35813 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35814 SCALED_PRESSURE_DATA::ID => {
35815 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35816 }
35817 SCALED_PRESSURE2_DATA::ID => {
35818 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35819 }
35820 SCALED_PRESSURE3_DATA::ID => {
35821 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35822 }
35823 SENSORPOD_STATUS_DATA::ID => {
35824 Some(Self::SENSORPOD_STATUS(SENSORPOD_STATUS_DATA::random(rng)))
35825 }
35826 SENSOR_AIRFLOW_ANGLES_DATA::ID => Some(Self::SENSOR_AIRFLOW_ANGLES(
35827 SENSOR_AIRFLOW_ANGLES_DATA::random(rng),
35828 )),
35829 SENS_ATMOS_DATA::ID => Some(Self::SENS_ATMOS(SENS_ATMOS_DATA::random(rng))),
35830 SENS_BATMON_DATA::ID => Some(Self::SENS_BATMON(SENS_BATMON_DATA::random(rng))),
35831 SENS_MPPT_DATA::ID => Some(Self::SENS_MPPT(SENS_MPPT_DATA::random(rng))),
35832 SENS_POWER_DATA::ID => Some(Self::SENS_POWER(SENS_POWER_DATA::random(rng))),
35833 SENS_POWER_BOARD_DATA::ID => {
35834 Some(Self::SENS_POWER_BOARD(SENS_POWER_BOARD_DATA::random(rng)))
35835 }
35836 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35837 SERVO_OUTPUT_RAW_DATA::ID => {
35838 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35839 }
35840 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35841 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35842 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35843 )),
35844 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35845 SET_ATTITUDE_TARGET_DATA::random(rng),
35846 )),
35847 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35848 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35849 )),
35850 SET_HOME_POSITION_DATA::ID => {
35851 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35852 }
35853 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35854 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35855 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35856 )),
35857 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35858 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35859 )),
35860 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35861 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35862 SMART_BATTERY_INFO_DATA::random(rng),
35863 )),
35864 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35865 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35866 STORAGE_INFORMATION_DATA::random(rng),
35867 )),
35868 SUPPORTED_TUNES_DATA::ID => {
35869 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35870 }
35871 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35872 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35873 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35874 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35875 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35876 TERRAIN_REQUEST_DATA::ID => {
35877 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35878 }
35879 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35880 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35881 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35882 )),
35883 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35884 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35885 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35886 ))
35887 }
35888 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35889 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35890 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35891 ))
35892 }
35893 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35894 UAVCAN_NODE_INFO_DATA::ID => {
35895 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35896 }
35897 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35898 UAVCAN_NODE_STATUS_DATA::random(rng),
35899 )),
35900 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35901 UTM_GLOBAL_POSITION_DATA::random(rng),
35902 )),
35903 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35904 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35905 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35906 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35907 VICON_POSITION_ESTIMATE_DATA::random(rng),
35908 )),
35909 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35910 VIDEO_STREAM_INFORMATION_DATA::random(rng),
35911 )),
35912 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35913 VIDEO_STREAM_STATUS_DATA::random(rng),
35914 )),
35915 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35916 VISION_POSITION_ESTIMATE_DATA::random(rng),
35917 )),
35918 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35919 VISION_SPEED_ESTIMATE_DATA::random(rng),
35920 )),
35921 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
35922 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
35923 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
35924 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
35925 _ => None,
35926 }
35927 }
35928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35929 match self {
35930 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35931 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
35932 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
35933 Self::AIS_VESSEL(body) => body.ser(version, bytes),
35934 Self::ALTITUDE(body) => body.ser(version, bytes),
35935 Self::ASLCTRL_DATA(body) => body.ser(version, bytes),
35936 Self::ASLCTRL_DEBUG(body) => body.ser(version, bytes),
35937 Self::ASLUAV_STATUS(body) => body.ser(version, bytes),
35938 Self::ASL_OBCTRL(body) => body.ser(version, bytes),
35939 Self::ATTITUDE(body) => body.ser(version, bytes),
35940 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
35941 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
35942 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
35943 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
35944 Self::AUTH_KEY(body) => body.ser(version, bytes),
35945 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
35946 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
35947 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
35948 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
35949 Self::BATTERY_INFO(body) => body.ser(version, bytes),
35950 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
35951 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
35952 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
35953 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
35954 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
35955 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
35956 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
35957 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
35958 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
35959 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
35960 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
35961 Self::CANFD_FRAME(body) => body.ser(version, bytes),
35962 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
35963 Self::CAN_FRAME(body) => body.ser(version, bytes),
35964 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
35965 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
35966 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
35967 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
35968 Self::COLLISION(body) => body.ser(version, bytes),
35969 Self::COMMAND_ACK(body) => body.ser(version, bytes),
35970 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
35971 Self::COMMAND_INT(body) => body.ser(version, bytes),
35972 Self::COMMAND_INT_STAMPED(body) => body.ser(version, bytes),
35973 Self::COMMAND_LONG(body) => body.ser(version, bytes),
35974 Self::COMMAND_LONG_STAMPED(body) => body.ser(version, bytes),
35975 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
35976 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
35977 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
35978 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
35979 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
35980 Self::CURRENT_MODE(body) => body.ser(version, bytes),
35981 Self::DATA_STREAM(body) => body.ser(version, bytes),
35982 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
35983 Self::DEBUG(body) => body.ser(version, bytes),
35984 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
35985 Self::DEBUG_VECT(body) => body.ser(version, bytes),
35986 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
35987 Self::EFI_STATUS(body) => body.ser(version, bytes),
35988 Self::EKF_EXT(body) => body.ser(version, bytes),
35989 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
35990 Self::ESC_INFO(body) => body.ser(version, bytes),
35991 Self::ESC_STATUS(body) => body.ser(version, bytes),
35992 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
35993 Self::EVENT(body) => body.ser(version, bytes),
35994 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
35995 Self::FENCE_STATUS(body) => body.ser(version, bytes),
35996 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
35997 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
35998 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
35999 Self::FUEL_STATUS(body) => body.ser(version, bytes),
36000 Self::FW_SOARING_DATA(body) => body.ser(version, bytes),
36001 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
36002 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
36003 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
36004 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
36005 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
36006 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
36007 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
36008 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
36009 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
36010 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
36011 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
36012 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36013 Self::GPS2_RAW(body) => body.ser(version, bytes),
36014 Self::GPS2_RTK(body) => body.ser(version, bytes),
36015 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36016 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
36017 Self::GPS_INPUT(body) => body.ser(version, bytes),
36018 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
36019 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
36020 Self::GPS_RTK(body) => body.ser(version, bytes),
36021 Self::GPS_STATUS(body) => body.ser(version, bytes),
36022 Self::GSM_LINK_STATUS(body) => body.ser(version, bytes),
36023 Self::HEARTBEAT(body) => body.ser(version, bytes),
36024 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
36025 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
36026 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
36027 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
36028 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
36029 Self::HIL_GPS(body) => body.ser(version, bytes),
36030 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
36031 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
36032 Self::HIL_SENSOR(body) => body.ser(version, bytes),
36033 Self::HIL_STATE(body) => body.ser(version, bytes),
36034 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
36035 Self::HOME_POSITION(body) => body.ser(version, bytes),
36036 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
36037 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
36038 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
36039 Self::LANDING_TARGET(body) => body.ser(version, bytes),
36040 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
36041 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
36042 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
36043 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
36044 Self::LOGGING_ACK(body) => body.ser(version, bytes),
36045 Self::LOGGING_DATA(body) => body.ser(version, bytes),
36046 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
36047 Self::LOG_DATA(body) => body.ser(version, bytes),
36048 Self::LOG_ENTRY(body) => body.ser(version, bytes),
36049 Self::LOG_ERASE(body) => body.ser(version, bytes),
36050 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
36051 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
36052 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
36053 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
36054 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
36055 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
36056 Self::MEMORY_VECT(body) => body.ser(version, bytes),
36057 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
36058 Self::MISSION_ACK(body) => body.ser(version, bytes),
36059 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
36060 Self::MISSION_COUNT(body) => body.ser(version, bytes),
36061 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
36062 Self::MISSION_ITEM(body) => body.ser(version, bytes),
36063 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
36064 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
36065 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
36066 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
36067 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
36068 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
36069 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
36070 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
36071 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
36072 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
36073 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
36074 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
36075 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
36076 Self::ODOMETRY(body) => body.ser(version, bytes),
36077 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
36078 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
36079 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
36080 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
36081 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
36082 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
36083 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
36084 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
36085 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
36086 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
36087 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
36088 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
36089 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
36090 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
36091 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
36092 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
36093 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
36094 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
36095 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
36096 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
36097 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
36098 Self::PARAM_SET(body) => body.ser(version, bytes),
36099 Self::PARAM_VALUE(body) => body.ser(version, bytes),
36100 Self::PING(body) => body.ser(version, bytes),
36101 Self::PLAY_TUNE(body) => body.ser(version, bytes),
36102 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
36103 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36104 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36105 Self::POWER_STATUS(body) => body.ser(version, bytes),
36106 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
36107 Self::RADIO_STATUS(body) => body.ser(version, bytes),
36108 Self::RAW_IMU(body) => body.ser(version, bytes),
36109 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
36110 Self::RAW_RPM(body) => body.ser(version, bytes),
36111 Self::RC_CHANNELS(body) => body.ser(version, bytes),
36112 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
36113 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
36114 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
36115 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
36116 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
36117 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
36118 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
36119 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
36120 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
36121 Self::SATCOM_LINK_STATUS(body) => body.ser(version, bytes),
36122 Self::SCALED_IMU(body) => body.ser(version, bytes),
36123 Self::SCALED_IMU2(body) => body.ser(version, bytes),
36124 Self::SCALED_IMU3(body) => body.ser(version, bytes),
36125 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
36126 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
36127 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
36128 Self::SENSORPOD_STATUS(body) => body.ser(version, bytes),
36129 Self::SENSOR_AIRFLOW_ANGLES(body) => body.ser(version, bytes),
36130 Self::SENS_ATMOS(body) => body.ser(version, bytes),
36131 Self::SENS_BATMON(body) => body.ser(version, bytes),
36132 Self::SENS_MPPT(body) => body.ser(version, bytes),
36133 Self::SENS_POWER(body) => body.ser(version, bytes),
36134 Self::SENS_POWER_BOARD(body) => body.ser(version, bytes),
36135 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
36136 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
36137 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
36138 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36139 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
36140 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36141 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
36142 Self::SET_MODE(body) => body.ser(version, bytes),
36143 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36144 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36145 Self::SIM_STATE(body) => body.ser(version, bytes),
36146 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
36147 Self::STATUSTEXT(body) => body.ser(version, bytes),
36148 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
36149 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
36150 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
36151 Self::SYS_STATUS(body) => body.ser(version, bytes),
36152 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
36153 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
36154 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
36155 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
36156 Self::TIMESYNC(body) => body.ser(version, bytes),
36157 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
36158 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
36159 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
36160 Self::TUNNEL(body) => body.ser(version, bytes),
36161 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
36162 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
36163 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
36164 Self::V2_EXTENSION(body) => body.ser(version, bytes),
36165 Self::VFR_HUD(body) => body.ser(version, bytes),
36166 Self::VIBRATION(body) => body.ser(version, bytes),
36167 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36168 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36169 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
36170 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36171 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
36172 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
36173 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
36174 Self::WINCH_STATUS(body) => body.ser(version, bytes),
36175 Self::WIND_COV(body) => body.ser(version, bytes),
36176 }
36177 }
36178 fn extra_crc(id: u32) -> u8 {
36179 match id {
36180 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36181 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
36182 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
36183 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
36184 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
36185 ASLCTRL_DATA_DATA::ID => ASLCTRL_DATA_DATA::EXTRA_CRC,
36186 ASLCTRL_DEBUG_DATA::ID => ASLCTRL_DEBUG_DATA::EXTRA_CRC,
36187 ASLUAV_STATUS_DATA::ID => ASLUAV_STATUS_DATA::EXTRA_CRC,
36188 ASL_OBCTRL_DATA::ID => ASL_OBCTRL_DATA::EXTRA_CRC,
36189 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
36190 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
36191 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
36192 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
36193 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
36194 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
36195 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36196 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
36197 }
36198 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
36199 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
36200 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
36201 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
36202 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
36203 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
36204 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
36205 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
36206 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
36207 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
36208 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
36209 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
36210 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
36211 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
36212 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
36213 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
36214 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
36215 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
36216 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
36217 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
36218 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
36219 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
36220 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
36221 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
36222 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
36223 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
36224 COMMAND_INT_STAMPED_DATA::ID => COMMAND_INT_STAMPED_DATA::EXTRA_CRC,
36225 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
36226 COMMAND_LONG_STAMPED_DATA::ID => COMMAND_LONG_STAMPED_DATA::EXTRA_CRC,
36227 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
36228 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
36229 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
36230 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
36231 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
36232 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
36233 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
36234 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
36235 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
36236 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
36237 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
36238 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
36239 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
36240 EKF_EXT_DATA::ID => EKF_EXT_DATA::EXTRA_CRC,
36241 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
36242 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
36243 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
36244 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
36245 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
36246 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
36247 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
36248 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
36249 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
36250 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
36251 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
36252 FW_SOARING_DATA_DATA::ID => FW_SOARING_DATA_DATA::EXTRA_CRC,
36253 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
36254 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
36255 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
36256 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
36257 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
36258 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
36259 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36260 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
36261 }
36262 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
36263 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
36264 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
36265 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
36266 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36267 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
36268 }
36269 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
36270 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
36271 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36272 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
36273 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
36274 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
36275 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
36276 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
36277 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
36278 GSM_LINK_STATUS_DATA::ID => GSM_LINK_STATUS_DATA::EXTRA_CRC,
36279 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
36280 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
36281 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
36282 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
36283 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
36284 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
36285 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
36286 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
36287 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
36288 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
36289 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
36290 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
36291 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
36292 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
36293 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
36294 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
36295 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
36296 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
36297 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
36298 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
36299 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36300 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
36301 }
36302 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
36303 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
36304 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
36305 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
36306 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
36307 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
36308 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
36309 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
36310 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
36311 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
36312 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
36313 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
36314 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
36315 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
36316 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
36317 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
36318 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
36319 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
36320 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
36321 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
36322 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
36323 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
36324 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
36325 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
36326 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
36327 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
36328 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
36329 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
36330 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
36331 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
36332 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
36333 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
36334 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
36335 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
36336 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
36337 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
36338 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
36339 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
36340 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
36341 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
36342 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
36343 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
36344 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
36345 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
36346 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
36347 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
36348 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
36349 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
36350 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
36351 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
36352 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
36353 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
36354 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
36355 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
36356 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
36357 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
36358 PING_DATA::ID => PING_DATA::EXTRA_CRC,
36359 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
36360 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
36361 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
36362 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36363 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
36364 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
36365 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
36366 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
36367 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
36368 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
36369 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
36370 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
36371 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
36372 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
36373 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
36374 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
36375 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
36376 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
36377 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36378 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36379 SATCOM_LINK_STATUS_DATA::ID => SATCOM_LINK_STATUS_DATA::EXTRA_CRC,
36380 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36381 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36382 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36383 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36384 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36385 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36386 SENSORPOD_STATUS_DATA::ID => SENSORPOD_STATUS_DATA::EXTRA_CRC,
36387 SENSOR_AIRFLOW_ANGLES_DATA::ID => SENSOR_AIRFLOW_ANGLES_DATA::EXTRA_CRC,
36388 SENS_ATMOS_DATA::ID => SENS_ATMOS_DATA::EXTRA_CRC,
36389 SENS_BATMON_DATA::ID => SENS_BATMON_DATA::EXTRA_CRC,
36390 SENS_MPPT_DATA::ID => SENS_MPPT_DATA::EXTRA_CRC,
36391 SENS_POWER_DATA::ID => SENS_POWER_DATA::EXTRA_CRC,
36392 SENS_POWER_BOARD_DATA::ID => SENS_POWER_BOARD_DATA::EXTRA_CRC,
36393 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36394 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36395 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36396 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36397 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36398 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36399 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36400 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36401 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36402 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36403 }
36404 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36405 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36406 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36407 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36408 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36409 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36410 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36411 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36412 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36413 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36414 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36415 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36416 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36417 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36418 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36419 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36420 }
36421 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36422 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36423 }
36424 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36425 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36426 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36427 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36428 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36429 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36430 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36431 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36432 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36433 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36434 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36435 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36436 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36437 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36438 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36439 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36440 _ => 0,
36441 }
36442 }
36443 fn target_system_id(&self) -> Option<u8> {
36444 match self {
36445 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36446 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36447 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36448 Self::CAN_FRAME(inner) => Some(inner.target_system),
36449 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36450 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36451 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36452 Self::COMMAND_INT(inner) => Some(inner.target_system),
36453 Self::COMMAND_INT_STAMPED(inner) => Some(inner.target_system),
36454 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36455 Self::COMMAND_LONG_STAMPED(inner) => Some(inner.target_system),
36456 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36457 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36458 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36459 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36460 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36461 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36462 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36463 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36464 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36465 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36466 Self::LOG_ERASE(inner) => Some(inner.target_system),
36467 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36468 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36469 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36470 Self::MISSION_ACK(inner) => Some(inner.target_system),
36471 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36472 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36473 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36474 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36475 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36476 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36477 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36478 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36479 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36480 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36481 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36482 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36483 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36484 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36485 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36486 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36487 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36488 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36489 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36490 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36491 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36492 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36493 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36494 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36495 Self::PARAM_SET(inner) => Some(inner.target_system),
36496 Self::PING(inner) => Some(inner.target_system),
36497 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36498 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36499 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36500 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36501 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36502 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36503 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36504 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36505 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36506 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36507 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36508 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36509 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36510 Self::SET_MODE(inner) => Some(inner.target_system),
36511 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36512 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36513 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36514 Self::TIMESYNC(inner) => Some(inner.target_system),
36515 Self::TUNNEL(inner) => Some(inner.target_system),
36516 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36517 _ => None,
36518 }
36519 }
36520 fn target_component_id(&self) -> Option<u8> {
36521 match self {
36522 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36523 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36524 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36525 Self::CAN_FRAME(inner) => Some(inner.target_component),
36526 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36527 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36528 Self::COMMAND_INT(inner) => Some(inner.target_component),
36529 Self::COMMAND_INT_STAMPED(inner) => Some(inner.target_component),
36530 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36531 Self::COMMAND_LONG_STAMPED(inner) => Some(inner.target_component),
36532 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36533 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36534 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36535 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36536 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36537 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36538 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36539 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36540 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36541 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36542 Self::LOG_ERASE(inner) => Some(inner.target_component),
36543 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36544 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36545 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36546 Self::MISSION_ACK(inner) => Some(inner.target_component),
36547 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36548 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36549 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36550 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36551 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36552 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36553 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36554 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36555 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36556 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36557 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36558 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36559 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36560 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36561 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36562 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36563 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36564 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36565 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36566 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36567 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36568 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36569 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36570 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36571 Self::PARAM_SET(inner) => Some(inner.target_component),
36572 Self::PING(inner) => Some(inner.target_component),
36573 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36574 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36575 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36576 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36577 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36578 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36579 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36580 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36581 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36582 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36583 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36584 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36585 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36586 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36587 Self::TIMESYNC(inner) => Some(inner.target_component),
36588 Self::TUNNEL(inner) => Some(inner.target_component),
36589 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36590 _ => None,
36591 }
36592 }
36593}